@alephium/web3 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/api/utils.js
CHANGED
|
@@ -21,8 +21,8 @@ exports.isBalanceEqual = exports.convertHttpResponse = void 0;
|
|
|
21
21
|
require("cross-fetch/polyfill");
|
|
22
22
|
function convertHttpResponse(response) {
|
|
23
23
|
if (response.error) {
|
|
24
|
-
const errorMessage = response.error.detail ?? `
|
|
25
|
-
throw new Error(`[API Error] - ${errorMessage}`);
|
|
24
|
+
const errorMessage = response.error.detail ?? `Unknown error`;
|
|
25
|
+
throw new Error(`[API Error] - ${errorMessage} - Status code: ${response.status}`);
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
return response.data;
|
package/package.json
CHANGED
package/src/api/utils.ts
CHANGED
|
@@ -21,8 +21,8 @@ import * as node from '../api/api-alephium'
|
|
|
21
21
|
|
|
22
22
|
export function convertHttpResponse<T>(response: { status: number; data: T; error?: { detail: string } }): T {
|
|
23
23
|
if (response.error) {
|
|
24
|
-
const errorMessage = response.error.detail ?? `
|
|
25
|
-
throw new Error(`[API Error] - ${errorMessage}`)
|
|
24
|
+
const errorMessage = response.error.detail ?? `Unknown error`
|
|
25
|
+
throw new Error(`[API Error] - ${errorMessage} - Status code: ${response.status}`)
|
|
26
26
|
} else {
|
|
27
27
|
return response.data
|
|
28
28
|
}
|