FIX: Better 0 file size detection and logging (#16116)

When creating files with create-multipart, if the file
size was somehow zero we were showing a very unhelpful
error message to the user. Now we show a nicer message,
and proactively don't call the API if we know the file
size is 0 bytes in JS, along with extra console logging
to help with debugging.
This commit is contained in:
Martin Brennan
2022-03-07 12:39:33 +10:00
committed by GitHub
parent 5f5acfa064
commit 7af01d88d2
7 changed files with 37 additions and 4 deletions

View File

@@ -25,10 +25,10 @@ function resizeWithAspect(
};
}
function logIfDebug(message) {
function logIfDebug(...messages) {
if (DedicatedWorkerGlobalScope.debugMode) {
// eslint-disable-next-line no-console
console.log(message);
console.log(...messages);
}
}