Skip to content

Commit

Permalink
feat: add error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
NaMax66 committed Dec 27, 2024
1 parent b23e6f4 commit 1f3b0dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client-app/core/composables/useImpersonate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function _useImpersonate() {
if (!data.value || error.value) {
status.value = "error";
} else {
const { access_token, token_type, expires_in, refresh_token, error: tokenError } = data.value;
const { access_token, token_type, expires_in, refresh_token, error: tokenError, errors } = data.value;

if (access_token && token_type && expires_in && refresh_token) {
setAccessToken(access_token);
Expand All @@ -48,11 +48,13 @@ export function _useImpersonate() {
void broadcast.emit(reloadAndOpenMainPage, null, TabsType.ALL);
}, 1000);
} else {
Logger.error(impersonate.name, tokenError);
notifications.error({ text: t("pages.account.impersonate.error") });
Logger.error(impersonate.name, tokenError, errors);
status.value = "error";
}
}
} catch (e) {
notifications.error({ text: t("pages.account.impersonate.error") });
Logger.error(impersonate.name, e);
status.value = "error";
}
Expand Down

0 comments on commit 1f3b0dc

Please sign in to comment.