We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 824296e + ea6d60a commit 10aa9f8Copy full SHA for 10aa9f8
src/api/index.ts
@@ -355,7 +355,17 @@ export class AtelierAPI {
355
}
356
357
const buffer = await response.buffer();
358
- const data: Atelier.Response = JSON.parse(buffer.toString("utf-8"));
+
359
+ const responseString = buffer.toString("utf-8");
360
+ if (!responseString.startsWith("{")) {
361
+ outputConsole(["", `Non-JSON response to ${path}`, ...responseString.split("\r\n")]);
362
+ throw {
363
+ statusCode: 500,
364
+ message: `Non-JSON response to ${path} request. View 'ObjectScript' channel on OUTPUT tab of Panel for details.`,
365
+ };
366
+ }
367
368
+ const data: Atelier.Response = JSON.parse(responseString);
369
370
// Decode encoded content
371
if (data.result && data.result.enc && data.result.content) {
0 commit comments