Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error presentation to user. #169

Closed
MicahZoltu opened this issue Jul 7, 2023 · 2 comments · Fixed by #204 or #208
Closed

Improve error presentation to user. #169

MicahZoltu opened this issue Jul 7, 2023 · 2 comments · Fixed by #204 or #208
Assignees
Labels
enhancement New feature or request high priority

Comments

@MicahZoltu
Copy link
Contributor

image

user rejected action (action="sendTransaction", reason="rejected", info={ "error": { "code": 4001, "data": { "request": { "method": "eth_sendTransaction", "params": [ { "data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000f478e084000", "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "gas": "0x8ee2", "to": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984" } ] } }, "message": "ethers-user-denied: Interceptor Tx Signature: User denied transaction signature." }, "payload": { "id": 52, "jsonrpc": "2.0", "method": "eth_sendTransaction", "params": [ { "data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000f478e084000", "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "gas": "0x8ee2", "to": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984" } ] } }, code=ACTION_REJECTED, version=6.6.1)

We should parse the error and look for and handle well known error codes. We should work with @KillariDev to ensure we at least support all of the Interceptor errors and present them to the user in a nice clean way.

We should still include the JSON, but perhaps hidden behind an Additional Details

section or something.

Note: this is relatively low priority.

@jubalm jubalm added the enhancement New feature or request label Jul 9, 2023
@jubalm
Copy link
Collaborator

jubalm commented Aug 10, 2023

  • if error code is recognized, present nice human readable error to the user
  • if error code is not recognized, present error.message clearly, and put error.data and any other details hidden behind a Details box or similar.
  • ethers error call_exception -> parse inner error message only

errors in ethers

@jubalm
Copy link
Collaborator

jubalm commented Oct 16, 2023

Closing with #210 having merged, which addresses this feature.

@jubalm jubalm closed this as completed Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
4 participants