We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90424e4 commit 8f41e4fCopy full SHA for 8f41e4f
1 file changed
sdk/javascript/src/client.ts
@@ -62,7 +62,9 @@ export default class Client {
62
!res.ok &&
63
res.headers.get("content-type") !== "application/json"
64
) {
65
- throw new Error(res.statusText);
+ const { error } = await res.json().catch(console.error);
66
+
67
+ throw new Error(error || res.statusText);
68
}
69
70
if (
0 commit comments