Skip to content

Commit

Permalink
errors: Add Wrap handy method (cosmos#8845)
Browse files Browse the repository at this point in the history
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 16, 2021
1 parent e66c4e6 commit 4bd695d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions types/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ func (e *Error) Is(err error) bool {
}
}

// Wrap extends this error with an additional information.
// It's a handy function to call Wrap with sdk errors.
func (e Error) Wrap(desc string) error { return Wrap(e, desc) }

// Wrapf extends this error with an additional information.
// It's a handy function to call Wrapf with sdk errors.
func (e Error) Wrapf(desc string, args ...interface{}) error { return Wrapf(e, desc, args...) }

func isNilErr(err error) bool {
// Reflect usage is necessary to correctly compare with
// a nil implementation of an error.
Expand Down

0 comments on commit 4bd695d

Please sign in to comment.