Return error class instance on upload error

This commit is contained in:
Kloon ImKloon 2024-02-16 16:35:03 +01:00
parent 7c89d19b83
commit 7d90effea6
No known key found for this signature in database
GPG Key ID: CCF1C86A995C5B6A

View File

@ -40,7 +40,7 @@ export async function upload(
"X-Auth": authStore.jwt,
},
onError: function (error) {
reject("Upload failed: " + error);
reject(new Error(`Upload failed: ${error.message}`));
},
onProgress: function (bytesUploaded) {
// Emulate ProgressEvent.loaded which is used by calling functions