Skip to content

Commit

Permalink
Fix propagation of errors from wallet request handler
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed Sep 18, 2024
1 parent 504d8a0 commit 5c5092f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/provider/src/transports/wallet-request-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class WalletRequestHandler implements EIP1193Provider, ProviderMessageReq
} catch (error) {
return {
...message,
data: isJsonRpcResponse ? { ...jsonRpcResponse, error } : error
data: isJsonRpcResponse ? { ...jsonRpcResponse, error } : { error }
}
}
}
Expand Down Expand Up @@ -639,7 +639,7 @@ export class WalletRequestHandler implements EIP1193Provider, ProviderMessageReq
}
} catch (err) {
logger.error(err)
throw { message: err?.message, code: 4001 } as ProviderRpcError
throw { message: typeof err == 'string' ? err : err?.message || 'unkown error', code: 4001 } as ProviderRpcError
}
}

Expand Down

0 comments on commit 5c5092f

Please sign in to comment.