mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 13:05:49 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user