From 7d90effea690c89dbb766507788a8cb6c614ea66 Mon Sep 17 00:00:00 2001 From: Kloon ImKloon Date: Fri, 16 Feb 2024 16:35:03 +0100 Subject: [PATCH] Return error class instance on upload error --- frontend/src/api/tus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/api/tus.ts b/frontend/src/api/tus.ts index bdc234d5..0e67deb1 100644 --- a/frontend/src/api/tus.ts +++ b/frontend/src/api/tus.ts @@ -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