diff --git a/package.json b/package.json index 98349d5c..12045269 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/wallet-sdk", - "version": "0.1.0-rc.2", + "version": "0.1.0-rc.3", "description": "Libraries to help you write Stellar-enabled wallets in Javascript", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/KeyManager.ts b/src/KeyManager.ts index a24992c6..3e97600a 100644 --- a/src/KeyManager.ts +++ b/src/KeyManager.ts @@ -317,19 +317,11 @@ export class KeyManager { ); if (challengeRes.status !== 200) { - try { - const challengeJson = await challengeRes.json(); - throw new Error( - `[KeyManager#fetchAuthToken] Failed to fetch a challenge transaction, - error: ${challengeJson.error}`, - ); - } catch (e) { - throw new Error( - `[KeyManager#fetchAuthToken] Failed to fetch a challenge transaction, - error code ${challengeRes.status} and status text - "${challengeRes.statusText}"`, - ); - } + const challengeText = await challengeRes.text(); + throw new Error( + `[KeyManager#fetchAuthToken] Failed to fetch a challenge transaction, + error: ${JSON.stringify(challengeText)}`, + ); } const keyNetwork = key.network || this.defaultNetworkPassphrase;