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

Error codes for Accounts constraints #9

Closed
armaniferrante opened this issue Jan 5, 2021 · 2 comments
Closed

Error codes for Accounts constraints #9

armaniferrante opened this issue Jan 5, 2021 · 2 comments

Comments

@armaniferrante
Copy link
Member

armaniferrante commented Jan 5, 2021

The DSL is currently very lazy with error codes. We should do this properly, generating an error for each constraint, adding those to the IDL, and having all clients report typed, informative errors, when the runtime responds with a particular error code.

There's also some boilierplate we should eliminate with a macro when creating custom errors for programs.

@armaniferrante
Copy link
Member Author

Part of this is addressed by #25. Namely, the ability to define custom, typed errors that propagate to the client.

The other part needed to be done is informative errors for the constraints in the #[derive(Accounts)] struct. Right now, we just return a bunch of useless ProgramError::Custom(1) errors.

@armaniferrante armaniferrante changed the title Error code generation Error codes for Accounts constraints Jan 21, 2021
@armaniferrante armaniferrante removed their assignment Apr 15, 2021
@armaniferrante
Copy link
Member Author

Completed by #354.

vadorovsky pushed a commit to vadorovsky/anchor that referenced this issue May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant