Skip to content

Commit 78d2f2a

Browse files
committed
throw error better way
1 parent a338c1c commit 78d2f2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export class AtelierAPI {
302302
}
303303

304304
if (!response.ok) {
305-
throw new Error("Unexpected error");
305+
throw { statusCode: response.status, statusText: response.statusText };
306306
}
307307

308308
const buffer = await response.buffer();

0 commit comments

Comments
 (0)