Skip to content

Commit

Permalink
minor fix for error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Jul 29, 2024
1 parent 5db779b commit 9d47457
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ export function notifyError(ArboratorGrewError: ArboratorGrewError_t) {
if (error !== undefined) {
if (error.response) {
if (error.response.status === 403) {
msg = error.response.data ? error.response.data.message.message : i18n.global.t('error403');
msg = error.response.data ? error.response.data.message : i18n.global.t('error403');
} else if (error.response.status === 401) {
msg = error.response.data ? error.response.data.message.message : i18n.global.t('error401');
msg = error.response.data ? error.response.data.message : i18n.global.t('error401');
} else if (error.response.status === 406) {
const grewErrorMessage = error.response.data.message || 'Unknown error, please contact the administrators';
msg = `Grew internal error : ${grewErrorMessage}`;
} else if (error.response.status === 415) {
msg = error.response.data ? error.response.data.message.message : i18n.global.t('error415');
msg = error.response.data ? error.response.data.message : i18n.global.t('error415');
} else {
msg = error.response.data ? error.response.data.message.message : `${error.response.statusText} error ${error.response.status}`;
msg = error.response.data ? error.response.data.message : `${error.response.statusText} error ${error.response.status}`;
}
}
} else if (error.message !== undefined) {
Expand Down

0 comments on commit 9d47457

Please sign in to comment.