From 8b6b44d1e4a6d0981f06f6b29d91685d65443c93 Mon Sep 17 00:00:00 2001 From: guibescos <59208140+guibescos@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:27:54 +0100 Subject: [PATCH] fix: sdk to not swallow errors (#302) * fix: sdk to not swallow errors * do it * update other places --- sdk/js/package.json | 2 +- sdk/js/src/index.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/js/package.json b/sdk/js/package.json index daac9b95..fa010d92 100644 --- a/sdk/js/package.json +++ b/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/express-relay-js", - "version": "0.16.1", + "version": "0.17.0", "description": "Utilities for interacting with the express relay protocol", "homepage": "https://github.com/pyth-network/per/tree/main/sdk/js", "author": "Douro Labs", diff --git a/sdk/js/src/index.ts b/sdk/js/src/index.ts index d494a213..9950823c 100644 --- a/sdk/js/src/index.ts +++ b/sdk/js/src/index.ts @@ -434,7 +434,7 @@ export class Client { }); if (response.error) { throw ClientError.newHttpError( - response.error.error, + JSON.stringify(response.error), response.response.status ); } @@ -467,7 +467,7 @@ export class Client { }); if (response.error) { throw ClientError.newHttpError( - response.error.error, + JSON.stringify(response.error), response.response.status ); } @@ -503,7 +503,7 @@ export class Client { }); if (response.error) { throw ClientError.newHttpError( - response.error.error, + JSON.stringify(response.error), response.response.status ); } else if (response.data === undefined) { @@ -526,7 +526,7 @@ export class Client { }); if (response.error) { throw ClientError.newHttpError( - response.error.error, + JSON.stringify(response.error), response.response.status ); } else if (response.data === undefined) {