Return error class instance on upload error
This commit is contained in:
parent
7c89d19b83
commit
7d90effea6
@ -40,7 +40,7 @@ export async function upload(
|
|||||||
"X-Auth": authStore.jwt,
|
"X-Auth": authStore.jwt,
|
||||||
},
|
},
|
||||||
onError: function (error) {
|
onError: function (error) {
|
||||||
reject("Upload failed: " + error);
|
reject(new Error(`Upload failed: ${error.message}`));
|
||||||
},
|
},
|
||||||
onProgress: function (bytesUploaded) {
|
onProgress: function (bytesUploaded) {
|
||||||
// Emulate ProgressEvent.loaded which is used by calling functions
|
// Emulate ProgressEvent.loaded which is used by calling functions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user