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

Preserve original error instance #1

Merged

Conversation

ro0gr
Copy link

@ro0gr ro0gr commented Mar 11, 2024

This in attempt to improve the san650#640 slightly. Feel free to accept or decline it. I think I'm in general fine to merge your PR as is.


This adds the cause.error which is supposed to keep the original error instance. So consumers may use it as

  ...
} catch (e) {
  assert.true(e.cause.error instanceof Error)
}

this is probably not the most elegant solution, but looks good enough to me for this rare(maybe I am wrong) usage scenario.

ro0gr added 2 commits March 11, 2024 23:36
...under the `cause.error`
in the `visitable` error instance
Copy link
Owner

@simonihmig simonihmig left a comment

Choose a reason for hiding this comment

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

Thanks, makes sense!

@simonihmig simonihmig merged commit 72aa2d8 into simonihmig:better-visit-errors Mar 13, 2024
14 checks passed
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