Skip to content

Commit

Permalink
Fix (another) error case in getTx()
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Nov 20, 2023
1 parent 457e249 commit a6473b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog & Version Info

## 1.12.3

Fix (another case of) error handling for "tx not found" in `getTx()`

## 1.12.1

Fix error handling for "tx not found" in `getTx()`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "secretjs",
"description": "The JavaScript SDK for Secret Network",
"version": "1.12.1",
"version": "1.12.2",
"license": "MIT",
"author": "SCRT Labs",
"bugs": {
Expand Down
7 changes: 6 additions & 1 deletion src/secret_network_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,14 @@ export class SecretNetworkClient {
? this.decodeTxResponse(tx_response, ibcTxOptions)
: null;
} catch (error) {
const txNotFoundRegex = new RegExp(
`tx not found: ${hash}|tx \\(${hash}\\) not found`,
"i",
);

if (
typeof error?.message == "string" &&
error?.message?.includes(`tx not found: ${hash}`)
error?.message?.match(txNotFoundRegex) !== null
) {
return null;
} else {
Expand Down

0 comments on commit a6473b6

Please sign in to comment.