diff --git a/packages/safe-apps-sdk/src/txs/index.ts b/packages/safe-apps-sdk/src/txs/index.ts index 075f60c3..c29b5db2 100644 --- a/packages/safe-apps-sdk/src/txs/index.ts +++ b/packages/safe-apps-sdk/src/txs/index.ts @@ -23,6 +23,12 @@ class TXs { try { const res = await fetch(`${this.#txServiceUrl}/transactions/${safeTxHash}`, options); + if (res.status !== 200) { + throw new Error( + "Failed to get the transaction. Either safeTxHash is incorrect or transaction hasn't been indexed by the service yet", + ); + } + const json = await res.json(); return json as TxServiceModel;