Skip to content

Commit f2c5f39

Browse files
committed
fix #469 error message on failed AtelierAPI.request
1 parent b1b475b commit f2c5f39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class AtelierAPI {
297297
checkConnection(true, typeof this.wsOrFile === "object" ? this.wsOrFile : undefined);
298298
}, 1000);
299299
}
300-
throw response;
300+
throw { statusCode: response.status, message: response.statusText };
301301
}
302302
await this.updateCookies(response.headers.raw()["set-cookie"] || []);
303303
panel.text = `${connInfo}`;
@@ -308,7 +308,7 @@ export class AtelierAPI {
308308
}
309309

310310
if (!response.ok) {
311-
throw { statusCode: response.status, statusText: response.statusText };
311+
throw { statusCode: response.status, message: response.statusText };
312312
}
313313

314314
const buffer = await response.buffer();

0 commit comments

Comments
 (0)