mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 00:31:33 +10:00
Drop will no longer crash when the server goes down
This commit is contained in:
11
plugins/global-error-handler.ts
Normal file
11
plugins/global-error-handler.ts
Normal 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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user