Skip to content

Implement std::error::Error for all public error types #415

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

Closed
theduke opened this issue Aug 20, 2019 · 2 comments · Fixed by #419
Closed

Implement std::error::Error for all public error types #415

theduke opened this issue Aug 20, 2019 · 2 comments · Fixed by #419
Labels
bug Something isn't working easy good-first-issue

Comments

@theduke
Copy link
Member

theduke commented Aug 20, 2019

  • GraphQLError
  • ParseError
  • LexerError
  • RuleError
  • FieldError
@theduke theduke added bug Something isn't working easy good-first-issue labels Aug 20, 2019
@davidpdrsn
Copy link
Contributor

I looked into this yesterday and it isn't totally straight forward. std::error::Error requires a Display implementation which Spanning<ParseError<'a>> and RuleError doesn't have. They should be possible to add but I wasn't sure what the most helpful implementations might be.

I might just make some initial implementation so we have something to discuss.

@theduke
Copy link
Member Author

theduke commented Aug 21, 2019

All errors should get a Error impl, it's a big oversight that they didn't have it yet.

The only limitation here is that we can't include surrounding input query lines in the error message but that's fine I think.

@theduke theduke changed the title Implement std::error::Error for GraphQLError Implement std::error::Error for all error types Aug 21, 2019
@theduke theduke changed the title Implement std::error::Error for all error types Implement std::error::Error for all public error types Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easy good-first-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants