misc: change error handling
This commit is contained in:
1 parent
10dc00080b
commit
bc089c3646
1 file changed
+6
-1
+6
-1
@@ -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}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user