forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core) Include causes when converting anyhow errors to JS exceptio…
…ns (denoland#16397) When an op returns an `anyhow` error with a cause (usually added using the `.context()` method), the `Error` thrown into JavaScript contains only the message of the outernmost error in the chain. This PR simply changes the formatting of `anyhow::Error` from `"{}"` to `"{:#}"`: This significantly improves errors for code that embeds Deno and defines custom ops. For example, in [chiselstrike/chiselstrike](https://github.com/chiselstrike/chiselstrike), this PR improves an error message like ``` Error: could not plan migration ``` to ``` Error: could not plan migration: could not migrate table for entity "E": could not add column for field "title": the field does not have a default value ```
- Loading branch information
Showing
3 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters