Skip to content

Commit

Permalink
Fix propagation of errors from wallet request handler (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook authored Sep 18, 2024
1 parent 504d8a0 commit f66fe59
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 f66fe59

Please sign in to comment.