8231_testToMaster_2448 #997
|
@ -3,6 +3,7 @@ import { useSession } from 'src/composables/useSession';
|
||||||
import { Router } from 'src/router';
|
import { Router } from 'src/router';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
import { useStateQueryStore } from 'src/stores/useStateQueryStore';
|
||||||
|
import { CanceledError } from 'axios';
|
||||||
|
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
@ -42,7 +43,7 @@ const onResponseError = (error) => {
|
||||||
let message = '';
|
let message = '';
|
||||||
|
|
||||||
const response = error.response;
|
const response = error.response;
|
||||||
const responseData = response && response.data;
|
const responseData = response?.data;
|
||||||
const responseError = responseData && response.data.error;
|
const responseError = responseData && response.data.error;
|
||||||
if (responseError) {
|
if (responseError) {
|
||||||
message = responseError.message;
|
message = responseError.message;
|
||||||
|
@ -78,7 +79,7 @@ const onResponseError = (error) => {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
notify(message, 'negative');
|
if (!(error instanceof CanceledError)) notify(message, 'negative');
|
||||||
|
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,6 +3,7 @@ import qFormMixin from './qformMixin';
|
||||||
import mainShortcutMixin from './mainShortcutMixin';
|
import mainShortcutMixin from './mainShortcutMixin';
|
||||||
import keyShortcut from './keyShortcut';
|
import keyShortcut from './keyShortcut';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import { CanceledError } from 'axios';
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
export default boot(({ app }) => {
|
export default boot(({ app }) => {
|
||||||
|
@ -11,6 +12,6 @@ export default boot(({ app }) => {
|
||||||
app.directive('shortcut', keyShortcut);
|
app.directive('shortcut', keyShortcut);
|
||||||
app.config.errorHandler = function (err) {
|
app.config.errorHandler = function (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
notify('globals.error', 'negative', 'error');
|
if (!(err instanceof CanceledError)) notify('globals.error', 'negative', 'error');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue