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.
1 parent b7a4551 commit 99644d9Copy full SHA for 99644d9
src/errors.ts
@@ -59,11 +59,12 @@ export function makeError(body: any, response: Response) {
59
return new TransactionError(body, response);
60
}
61
62
- if (body?.message) {
63
- return new ApiError(body.message, body.status, body.details, response);
64
- }
65
-
66
- return new Error(response.statusText);
+ return new ApiError(
+ body?.message || response.statusText || response.status,
+ body?.status || response.status,
+ body?.details,
+ response,
67
+ );
68
69
70
export type SdkError = ApiError | TransactionError | Error;
0 commit comments