Skip to content

Commit

Permalink
samples/web-csr/dressca-frontend/consumer/src/api-client/index.ts の競合を解決
Browse files Browse the repository at this point in the history
  • Loading branch information
KentaHizume committed Dec 26, 2024
1 parent 6f11d19 commit bfaf778
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ axiosInstance.interceptors.response.use(
(error) => {
if (axios.isAxiosError(error)) {
if (!error.response) {
return Promise.reject(new NetworkError('Network Error', error));
return Promise.reject(new NetworkError(error.message, error));
}
if (error.response.status === HttpStatusCode.InternalServerError) {
return Promise.reject(new ServerError('Server Error', error));
return Promise.reject(new ServerError(error.message, error));
}
if (error.response.status === HttpStatusCode.Unauthorized) {
return Promise.reject(
new UnauthorizedError('Unauthorized Error', error),
);
return Promise.reject(new UnauthorizedError(error.message, error));
}

return Promise.reject(new HttpError(error.message, error));
Expand Down

0 comments on commit bfaf778

Please sign in to comment.