Skip to content

Commit

Permalink
feature: change to display error messages from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dzn committed Sep 10, 2023
1 parent 0f37125 commit 460d96f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion apps/web/public/locales/en/error-page.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

"500": {
"description": "SERVER ERROR",
"content": "The server encountered an internal error or misconfiguration and was unable to complete your request.",
"home-router": "Go to Home"
},

Expand Down
1 change: 0 additions & 1 deletion apps/web/public/locales/ko/error-page.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

"500": {
"description": "서버 에러 발생",
"content": "서버에 내부 오류 또는 구성 오류가 발생하여 요청을 완료할 수 없습니다.",
"home-router": "홈으로 이동"
},

Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/form/components/Confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const Confirmation = ({ isMobile, userInfo, resumeInfo }: ConfirmationProps) =>
pathname,
});
},
onError: () => {
alert(t('error-page:500.content'));
onError: (error: any) => {
alert(error.response?.data.errorMessage);
},
},
);
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/modules/pdf/components/PdfForm/PdfForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export function PDFForm({ userInfo }: PDFFormProps) {
pathname,
});
},
onError: () => {
alert(t('error-page:500.content'));
onError: (error: any) => {
alert(error.response?.data.errorMessage);
},
},
);
Expand Down

0 comments on commit 460d96f

Please sign in to comment.