misc: change error handling

This commit is contained in:
Xyphyn committed 2023-08-20 11:36:46 -07:00
1 parent 10dc00080b
commit bc089c3646
1 file changed
+6 -1
+6 -1
View File
@@ -85,5 +85,10 @@ export async function uploadImage(
}`
}
throw new Error(`error uploading image: ${response.status}`)
throw new Error(
`${
(await response.text().catch((_) => undefined)) ??
'Failed to upload image'
}: ${response.status}: ${response.statusText}`
)
}