We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 766a814 commit 7d62e97Copy full SHA for 7d62e97
1 file changed
lib/CloudConvert.ts
@@ -153,10 +153,14 @@ export default class CloudConvert {
153
// @ts-expect-error incorrect types in @types/node@20
154
duplex: 'half'
155
});
156
+ if (!res.ok) {
157
+ // @ts-expect-error cause not present in types yet
158
+ throw new Error(res.statusText, { cause: res });
159
+ }
160
+
161
if (
- !res.ok ||
162
res.headers.get('Content-Type')?.toLowerCase() !==
- 'application/json'
163
+ 'application/json'
164
) {
165
return undefined;
166
}
0 commit comments