Skip to content

Commit

Permalink
Log returned errors from API
Browse files Browse the repository at this point in the history
  • Loading branch information
shaikatzz committed May 28, 2024
1 parent f56b3d6 commit 71d61c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/services/api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const handleErrors = (error: any | Error | AxiosError): never => {
const statusCode = error.response?.status;
const title = errorAxiosResponse?.title;
const message = errorAxiosResponse?.message || defaultErrorMessage;
logger.error(message);
const traceId = errorAxiosResponse?.traceId?.toString();
printTraceIdIfPresent(traceId, statusCode);
throw new HttpError(message, title, statusCode);
Expand Down

0 comments on commit 71d61c3

Please sign in to comment.