From 61875713341a60283a34ae668ca8680301802762 Mon Sep 17 00:00:00 2001 From: Jackson Mills Date: Tue, 26 Jul 2022 13:07:02 -0700 Subject: [PATCH] Make the unknown submitAndWait error more verbose (#2056) * Make the unknown submitAndWait error more verbose --- packages/xrpl/HISTORY.md | 1 + packages/xrpl/src/sugar/submit.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/xrpl/HISTORY.md b/packages/xrpl/HISTORY.md index 7e8eeeac..98bd07c2 100644 --- a/packages/xrpl/HISTORY.md +++ b/packages/xrpl/HISTORY.md @@ -6,6 +6,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr ### Fixed * `Wallet.fromMnemonic` now allows lowercase for RFC1751 mnemonics (#2046) * `Wallet.fromMnemonic` detects when an invalid encoding is provided, and throws an error +* Made unexpected errors in `submitAndWait` more verbose to make them easier to debug. ## 2.3.1 (2022-06-27) ### Fixed diff --git a/packages/xrpl/src/sugar/submit.ts b/packages/xrpl/src/sugar/submit.ts index 3091a175..fc3fb38e 100644 --- a/packages/xrpl/src/sugar/submit.ts +++ b/packages/xrpl/src/sugar/submit.ts @@ -157,7 +157,11 @@ async function waitForFinalTransactionOutcome( submissionResult, ) } - throw new Error(`${message} \n Preliminary result: ${submissionResult}.`) + throw new Error( + `${message} \n Preliminary result: ${submissionResult}.\nFull error details: ${String( + error, + )}`, + ) }) if (txResponse.result.validated) {