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

feat: Errors now wrap underlying errors #479

Merged
merged 1 commit into from
Sep 17, 2020
Merged

Conversation

mitar
Copy link
Contributor

@mitar mitar commented Sep 16, 2020

Related issue

Fixes #458.

Proposed changes

All errors wrap now underlying errors, when there is one available. This is not directly exposed through messages, but if you obtain such error in your code you have more information to inspect, log, and act upon.

I also changed around the codebase to remove hard-coded assumptions about the depth of a cause when inspecting errors and use errors.Is and errors.As instead.

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you for your contribution!

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.

Better propagation of underlying errors
4 participants