mirror of
https://github.com/Dangoware/confetti-box.git
synced 2025-04-19 15:22:57 -05:00
Properly show errors in file bars again
This commit is contained in:
parent
ca63739bfb
commit
4ca0f50685
1 changed files with 3 additions and 0 deletions
|
@ -83,9 +83,11 @@ async function uploadFile(file, duration, maxSize) {
|
||||||
const [linkRow, progressBar, progressText] = await addNewToList(file.name);
|
const [linkRow, progressBar, progressText] = await addNewToList(file.name);
|
||||||
if (file.size > maxSize) {
|
if (file.size > maxSize) {
|
||||||
console.error("Provided file is too large", file.size, "bytes; max", maxSize, "bytes");
|
console.error("Provided file is too large", file.size, "bytes; max", maxSize, "bytes");
|
||||||
|
makeErrored(progressBar, progressText, linkRow, TOO_LARGE_TEXT);
|
||||||
return;
|
return;
|
||||||
} else if (file.size == 0) {
|
} else if (file.size == 0) {
|
||||||
console.error("Provided file has 0 bytes");
|
console.error("Provided file has 0 bytes");
|
||||||
|
makeErrored(progressBar, progressText, linkRow, ZERO_TEXT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +108,7 @@ async function uploadFile(file, duration, maxSize) {
|
||||||
chunkedResponse = await response.json();
|
chunkedResponse = await response.json();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
makeErrored(progressBar, progressText, linkRow, ERROR_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload the file in `chunk_size` chunks
|
// Upload the file in `chunk_size` chunks
|
||||||
|
|
Loading…
Reference in a new issue