Skip to content

Commit

Permalink
AD-219 ErrorHandler logic fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz756 committed Apr 10, 2024
1 parent 8bce74c commit e24955c
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ export class ErrorHandler {

public static handleError(error?: AxiosError<ErrorResponse>) {
let errorResponseData
if (!error) {
if (!error || !error.response || !error.response.data || isEmpty(error.response.data.errorCode)) {
errorResponseData = createDefaultResponseData()
} else {
errorResponseData = error.response.data;
if (!errorResponseData || isEmpty(errorResponseData.errorCode)) {
errorResponseData = createDefaultResponseData()
}
}
store.dispatch({type: "notifications/addNotification", payload: createError(errorResponseData)})
}
Expand Down

0 comments on commit e24955c

Please sign in to comment.