Skip to content

Commit 08ff52e

Browse files
committed
T-285 handle invalid server response
1 parent c0dfdb3 commit 08ff52e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

index.node.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ export class Cinnamon {
153153
json.errors.map((error: Error) => error.message).join('\n'),
154154
);
155155
}
156+
if (!json.data) {
157+
throw new Error(`Invalid server response: ${JSON.stringify(json)}`);
158+
}
156159
return json;
157160
}
158161

0 commit comments

Comments
 (0)