Skip to content

Commit 6198204

Browse files
committed
fix(upload): show error message if file is too large
1 parent 295333c commit 6198204

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

addon/utils/error-handler.js

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export class ErrorHandler {
1919
return this.notification.danger(
2020
this.intl.t("alexandria.errors.no-permission"),
2121
);
22+
} else if (firstError?.status === "413") {
23+
return this.notification.danger(
24+
this.intl.t("alexandria.errors.file-too-large"),
25+
);
2226
} else if (
2327
firstError?.status === "400" &&
2428
firstError?.source.pointer === "/data"

translations/de.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ alexandria:
2121
no-permission: "Sie haben keine Berechtigung, diese Aktion auszuführen."
2222
move-document: "Beim Verschieben {count, plural, one {des Dokumentes} other {von # Dokumenten}} ist ein Fehler aufgetreten"
2323
convert-pdf: "Während dem Umwandeln ist ein Fehler aufgetreten."
24-
invalid-file-type: "In der Kategorie \"{category}\" können nur {types} hochgeladen werden."
24+
invalid-file-type: 'In der Kategorie "{category}" können nur {types} hochgeladen werden.'
25+
file-too-large: "Die hochgeladene Datei ist zu gross."
2526

2627
success:
2728
delete-document: "Das Dokument wurde erfolgreich gelöscht."

translations/en.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ alexandria:
2121
no-permission: "You don't have permission to perform this action."
2222
move-document: "While moving {count, plural, one {the document} other {# documents}}, an error occured. Please try again."
2323
convert-pdf: "While converting, an error occured. Please try again."
24-
invalid-file-type: "In category \"{category}\" only {types} can be uploaded."
24+
invalid-file-type: 'In category "{category}" only {types} can be uploaded.'
25+
file-too-large: "The uploaded file is too large."
2526

2627
success:
2728
delete-document: "Document deleted successfully"

0 commit comments

Comments
 (0)