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

More user friendly Anchor error codes #67

Closed
DXist opened this issue Jul 17, 2022 · 2 comments
Closed

More user friendly Anchor error codes #67

DXist opened this issue Jul 17, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@DXist
Copy link

DXist commented Jul 17, 2022

I came across multiple Anchor errors like

 RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0xbc4

It would be more helpful instead of hex codes to get user friendly error output based on https://docs.rs/anchor-lang/latest/src/anchor_lang/error.rs.html#22

@stefanprokopdev
Copy link
Contributor

Hey @DXist!

Thank you for the report! We are not handling the anchor errors and it's not our priority to do so right now but if you want, you can take a look at it and create a PR 💪

If you have a problem like this, just convert the 0xbc4 to decimal number and try to find it in anchor docs: https://docs.rs/anchor-lang/latest/anchor_lang/error/enum.ErrorCode.html.

Your error is 3012 which should be this one: https://docs.rs/anchor-lang/latest/anchor_lang/error/enum.ErrorCode.html#variant.AccountNotInitialized

@DXist
Copy link
Author

DXist commented Jul 18, 2022

Yes, I've converted these codes manually. But it took me some time to understand that this error code comes from Anchor and to find the enum with codes.

If it's not possible to separate Anchor error codes from error codes of other programs then it would be good enough just to convert it to decimal value and provide the link to the enum documentation.

Can we introduce 'improvement' label for this issue to mark low priority status?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants