Skip to content

Commit db3ee81

Browse files
committed
error_handler: add 403
1 parent beff6d3 commit db3ee81

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/lib/api/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const apiConfig = {
1111
};
1212
const http = axios.create(apiConfig);
1313

14-
const HTTP_STATUS_CODES_WITH_ERROR_PAGE = [404, 429, 500];
14+
const HTTP_STATUS_CODES_WITH_ERROR_PAGE = [404, 403, 429, 500];
1515
const URLS_NOT_TO_REDIRECT_IF_UNAUTHORIZED = ['/me', '/me/loans'];
1616
// CSRF possible errors
1717
const CSRF_ERROR_REASON_NO_COOKIE = 'CSRF cookie';

src/lib/pages/frontsite/ErrorsPage/ErrorsPage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
InternalServerError,
44
NotFound,
55
TooManyRequests,
6+
Unauthorized,
67
} from '@components/HttpErrors';
78

89
export class ErrorsPage extends Component {
@@ -17,6 +18,8 @@ export class ErrorsPage extends Component {
1718
return <InternalServerError />;
1819
} else if (params.errorCode === 404) {
1920
return <NotFound />;
21+
} else if (params.errorCode === 403) {
22+
return <Unauthorized />;
2023
} else if (params.errorCode === 429) {
2124
return <TooManyRequests />;
2225
}

0 commit comments

Comments
 (0)