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

Added terrors.Verbose() #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added terrors.Verbose() #39

wants to merge 1 commit into from

Conversation

dwb
Copy link

@dwb dwb commented Jul 28, 2022

This allows you to mark terror.Errors as "verbose". The most useful
upshot of this, as mentioned in the godoc, is so that you can get more
information in a failed test if you write

require.NoError(t, terrors.Verbose(err))

This will cause err.Error() on the returned error to return
the VerboseString() rather than the regular short one.

(Also updated testify to the same version as used elsewhere in the org,
so that I can use the require package.)

This allows you to mark terror.Errors as "verbose". The most useful
upshot of this, as mentioned in the godoc, is so that you can get more
information in a failed test if you write

```go
require.NoError(t, terrors.Verbose(err))
```

This will cause `err.Error()` on the returned error to return
the `VerboseString()` rather than the regular short one.
@dwb dwb mentioned this pull request Jul 28, 2022
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.

1 participant