diff --git a/src/boot/axios.js b/src/boot/axios.js index 3bd80f487..d3e981adb 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -3,6 +3,7 @@ import { useSession } from 'src/composables/useSession'; import { Router } from 'src/router'; import useNotify from 'src/composables/useNotify.js'; import { useStateQueryStore } from 'src/stores/useStateQueryStore'; +import { CanceledError } from 'axios'; const session = useSession(); const { notify } = useNotify(); @@ -42,7 +43,7 @@ const onResponseError = (error) => { let message = ''; const response = error.response; - const responseData = response && response.data; + const responseData = response?.data; const responseError = responseData && response.data.error; if (responseError) { message = responseError.message; @@ -78,7 +79,7 @@ const onResponseError = (error) => { return Promise.reject(error); } - notify(message, 'negative'); + if (!(error instanceof CanceledError)) notify(message, 'negative'); return Promise.reject(error); }; diff --git a/src/boot/quasar.js b/src/boot/quasar.js index 5db6edd24..41a7990c7 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -3,6 +3,7 @@ import qFormMixin from './qformMixin'; import mainShortcutMixin from './mainShortcutMixin'; import keyShortcut from './keyShortcut'; import useNotify from 'src/composables/useNotify.js'; +import { CanceledError } from 'axios'; const { notify } = useNotify(); export default boot(({ app }) => { @@ -11,6 +12,6 @@ export default boot(({ app }) => { app.directive('shortcut', keyShortcut); app.config.errorHandler = function (err) { console.error(err); - notify('globals.error', 'negative', 'error'); + if (!(err instanceof CanceledError)) notify('globals.error', 'negative', 'error'); }; });