mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-11 12:22:21 +01:00
Compare commits
1 Commits
d2f50dcd3a
...
af8a503456
| Author | SHA1 | Date | |
|---|---|---|---|
| af8a503456 |
@ -179,14 +179,13 @@
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
if (e instanceof Response) {
|
||||
// Intercept an HTTP 413 error (entity too large), as this might
|
||||
// be thrown by a (reverse) proxy server and its payload is not
|
||||
// nicely formatted as the code below expects.
|
||||
if (e.status === 413) {
|
||||
this.fileObjects[i].error_message = "The song you tried to upload is too large in size. (HTTP 413 error)";
|
||||
this.fileObjects[i].success = false;
|
||||
} else {
|
||||
this.fileObjects[i].error_message = `${e.statusText} (${e.status})`;
|
||||
try {
|
||||
e.json().then(data => {
|
||||
this.fileObjects[i].error_message = data.errorMessage;
|
||||
this.fileObjects[i].success = false;
|
||||
});
|
||||
} catch {
|
||||
this.fileObjects[i].error_message = "An exception occurred while uploading this file, please try again.";
|
||||
this.fileObjects[i].success = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user