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

anchor: add custom error for raw constraint #905

Merged
merged 3 commits into from
Oct 21, 2021

Conversation

fanatid
Copy link
Contributor

@fanatid fanatid commented Oct 20, 2021

Issue #509

  • Should we add custom error support for all constraints?
  • Is there a way to allow custom errors for Signer / Program?
  • We can't use ? because it's parsed with expr, are we ok with @?

@armaniferrante
Copy link
Member

LGTM.

  • Probably, though happy to start with constraint = only for now.
  • No, but we can solve that by mapping the error and logging the context (e.g. the variable name and key)
  • @ sounds good to me

@fanatid
Copy link
Contributor Author

fanatid commented Oct 20, 2021

Thanks. I think I need to add some documentation and lines to CHANGELOG.md before merging.

@fanatid
Copy link
Contributor Author

fanatid commented Oct 21, 2021

Updated. I also moved errors-related code to functions, so adding custom errors for other constraints should be easy.

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

Successfully merging this pull request may close these issues.

2 participants