@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.
@@ -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 ?? `status code: ${response.status}`;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alephium/web3",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "A JS/TS library to interact with the Alephium platform",
5
5
  "license": "GPL",
6
6
  "main": "dist/src/index.js",
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 ?? `status code: ${response.status}`
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
  }