Skip to content

Commit

Permalink
Add Spring Boot default error message to enum
Browse files Browse the repository at this point in the history
  • Loading branch information
cskrov committed Dec 29, 2023
1 parent bf46599 commit ed55de0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/language/en.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ export const en: Language = {
].map((c, index) => <span key={index}>{c}</span>),
},
error_messages: {
[ErrorMessageKeys.MAX_UPLOAD_SIZE]: 'The file size cannot be larger than 8 MB.',
[ErrorMessageKeys.TOO_LARGE]: 'The file size cannot be larger than 8 MB.',
[ErrorMessageKeys.TOTAL_TOO_LARGE]: 'Total file size cannot exceed 32 MB.',
[ErrorMessageKeys.ENCRYPTED]: 'We suspect that your file is encrypted, therefore it cannot be included.',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/language/error-messages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum ErrorMessageKeys {
MAX_UPLOAD_SIZE = 'Maximum upload size exceeded', // Spring Boot default error message.
TOO_LARGE = 'TOO_LARGE',
TOTAL_TOO_LARGE = 'TOTAL_TOO_LARGE',
ENCRYPTED = 'ENCRYPTED',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/language/nb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export const nb = {
].map((c, index) => <span key={index}>{c}</span>),
},
error_messages: {
[ErrorMessageKeys.MAX_UPLOAD_SIZE]: 'Filstørrelsen kan ikke være større enn 8 MB.',
[ErrorMessageKeys.TOO_LARGE]: 'Filstørrelsen kan ikke være større enn 8 MB.',
[ErrorMessageKeys.TOTAL_TOO_LARGE]: 'Total filstørrelse kan ikke være større enn 32 MB.',
[ErrorMessageKeys.ENCRYPTED]: 'Vi mistenker at filen din er kryptert, den kan derfor ikke sendes med.',
Expand Down

0 comments on commit ed55de0

Please sign in to comment.