From 5ca38ca825651c4d7ce98bab7082f1d43d34739a Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 18 Sep 2024 14:48:15 +0200 Subject: [PATCH] feat: global handler --- src/boot/quasar.js | 6 ++++++ src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + 3 files changed, 8 insertions(+) diff --git a/src/boot/quasar.js b/src/boot/quasar.js index e2035c880..5db6edd24 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -2,9 +2,15 @@ import { boot } from 'quasar/wrappers'; import qFormMixin from './qformMixin'; import mainShortcutMixin from './mainShortcutMixin'; import keyShortcut from './keyShortcut'; +import useNotify from 'src/composables/useNotify.js'; +const { notify } = useNotify(); export default boot(({ app }) => { app.mixin(qFormMixin); app.mixin(mainShortcutMixin); app.directive('shortcut', keyShortcut); + app.config.errorHandler = function (err) { + console.error(err); + notify('globals.error', 'negative', 'error'); + }; }); diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e27dc7bd4..2e2365f7b 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -103,6 +103,7 @@ globals: ticket: Ticket campaign: Campaign weight: Weight + error: Ups! Something went wrong pageTitles: logIn: Login addressEdit: Update address diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index ed34c8761..53b487e9f 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -105,6 +105,7 @@ globals: ticket: Ticket campaign: Campaña weight: Peso + error: ¡Ups! Algo salió mal pageTitles: logIn: Inicio de sesión addressEdit: Modificar consignatario