Skip to content

Commit

Permalink
Fixed: error handling in login process in case of object in error (dx…
Browse files Browse the repository at this point in the history
…p-258)
  • Loading branch information
Ritika-Patel08 committed Feb 7, 2024
1 parent a6b2369 commit 419be45
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ const actions: ActionTree<UserState, RootState> = {
// TODO Check if handling of specific status codes is required.
showToast(translate('Something went wrong while login. Please contact administrator'));
console.error("error", err);
// Added ternary check for serverResponse as in to correctly display the message on UI, need to remove this once all the service reject in same format
return Promise.reject(new Error(err?.serverResponse ? err.serverResponse : err))
return Promise.reject(err instanceof Object ? err : new Error(err));
}
},

Expand Down

0 comments on commit 419be45

Please sign in to comment.