Fix reliable submission masking legitimate error with type error (#1996)

* Avoid unsafe access to error.data.error

* Update HISTORY.md
This commit is contained in:
Jackson Mills
2022-05-10 13:54:24 -07:00
committed by GitHub
parent 0486037ee4
commit 317e223ce7
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
## Unreleased
### Fixed
* Client.disconnect() now stops the heartbeat health check as well
* Errors during reliable submission with no error message now properly show the preliminary result instead of a type error
## 2.2.3 (2022-05-04)
### Fixed

View File

@@ -148,7 +148,7 @@ async function waitForFinalTransactionOutcome(
.catch(async (error) => {
// error is of an unknown type and hence we assert type to extract the value we need.
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions,@typescript-eslint/no-unsafe-member-access -- ^
const message = error.data.error as string
const message = error?.data?.error as string
if (message === 'txnNotFound') {
return waitForFinalTransactionOutcome(
client,