diff --git a/.changeset/solid-flowers-see.md b/.changeset/solid-flowers-see.md new file mode 100644 index 00000000..d5ff32f6 --- /dev/null +++ b/.changeset/solid-flowers-see.md @@ -0,0 +1,6 @@ +--- +'@relayprotocol/relay-kit-hooks': patch +'@relayprotocol/relay-sdk': patch +--- + +Fix async errors not caught diff --git a/packages/hooks/src/hooks/useExecutionStatus.ts b/packages/hooks/src/hooks/useExecutionStatus.ts index af9fd803..dcba0564 100644 --- a/packages/hooks/src/hooks/useExecutionStatus.ts +++ b/packages/hooks/src/hooks/useExecutionStatus.ts @@ -73,9 +73,11 @@ export default function ( queryFn: () => { onRequest?.() const promise = queryExecutionStatus(client?.baseApiUrl, options) - promise.then((response: any) => { - onResponse?.(response) - }) + promise + .then((response: any) => { + onResponse?.(response) + }) + .catch(() => {}) return promise }, enabled: client !== undefined && options !== undefined, diff --git a/packages/sdk/src/utils/transaction.ts b/packages/sdk/src/utils/transaction.ts index c6b9f5dc..481ffbab 100644 --- a/packages/sdk/src/utils/transaction.ts +++ b/packages/sdk/src/utils/transaction.ts @@ -574,6 +574,12 @@ const postSameChainTransactionToSolver = async ({ LogLevel.Verbose ) }) + .catch((e) => { + getClient()?.log( + ['Failed to post same chain transaction to solver', e], + LogLevel.Warn + ) + }) } catch (e) { getClient()?.log( ['Failed to post same chain transaction to solver', e], @@ -628,6 +634,12 @@ const postTransactionToSolver = async ({ LogLevel.Verbose ) }) + .catch((e) => { + getClient()?.log( + ['Failed to post transaction to solver', e], + LogLevel.Warn + ) + }) } catch (e) { getClient()?.log( ['Failed to post transaction to solver', e],