Drop will no longer crash when the server goes down

This commit is contained in:
DecDuck
2024-11-03 19:47:27 +11:00
parent df88395d98
commit eb3311a0c4
5 changed files with 187 additions and 77 deletions

View File

@ -0,0 +1,11 @@
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.config.errorHandler = (error, instance, info) => {
// handle error, e.g. report to a service
};
// Also possible
nuxtApp.hook("vue:error", (error, instance, info) => {
const router = useRouter();
router.replace("/error");
});
});