diff --git a/src/plugins/app.ts b/src/plugins/app.ts index acdd2ca09..f2080ef7f 100644 --- a/src/plugins/app.ts +++ b/src/plugins/app.ts @@ -1,7 +1,15 @@ import { h } from 'vue'; +import type { App } from 'vue'; import { NButton } from 'naive-ui'; import { $t } from '@/locales'; +export function setupAppErrorHandle(app: App) { + app.config.errorHandler = (err, vm, info) => { + // eslint-disable-next-line no-console + console.error(err, vm, info); + }; +} + export function setupAppVersionNotification() { const canAutoUpdateApp = import.meta.env.VITE_AUTOMATICALLY_DETECT_UPDATE === 'Y';