Skip to content

Commit

Permalink
[#21] Add generic server error to translations
Browse files Browse the repository at this point in the history
  • Loading branch information
liamstevens111 committed Mar 1, 2023
1 parent 9d0540f commit 61d68f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"password": "Password",
"forgot-password": "Forgot?",
"invalid-email": "Email has invalid format",
"invalid-password": "Password should be at least {{passwordMinLength}}"
"invalid-password": "Password should be at least {{passwordMinLength}}",
"generic-server-error": "There was a problem receiving a response from the server"
}
}
2 changes: 1 addition & 1 deletion src/screens/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function LoginScreen() {

navigate('/');
} catch (error) {
let errorMessage = 'There was a problem receiving a response from the server';
let errorMessage = t('login.generic-server-error');

if (error instanceof Error) {
errorMessage = (error as AxiosError).response?.data?.errors[0]?.detail || error.cause || errorMessage;
Expand Down

0 comments on commit 61d68f0

Please sign in to comment.