-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dig error types & reporting, more easily distinguish Dig error…
…s vs. non-Dig errors (#360) This update: - Introduces the dig.Error interface, which is implemented by all errors returned by Dig, allowing users to use errors.Is and errors.As with Dig errors. - Replaces the concept of errors causing other errors (i.e. the causer interface) with Go's error wrapping conventions, so errors caused by other errors can now be unwrapped to their causing error with errors.Unwrap. - Updates the behavior of dig.RootCause to return the first non-dig.Error in the chain of errors passed to it, if there is one. Otherwise, it will return the first error that does not wrap another error (the bottom of the chain). - Adds tests testing the new behavior of dig.RootCause in error_test.go
- Loading branch information
Showing
15 changed files
with
389 additions
and
438 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
Oops, something went wrong.