Remove wrapper functions in errors package

This way, our own errors package does not appear in the stack traces.
This commit is contained in:
Alexander Neumann 2016-09-18 13:28:59 +02:00
parent 2b9a408ccc
commit b090c73bd4

View file

@ -7,17 +7,14 @@ func Cause(err error) error {
return errors.Cause(err) return errors.Cause(err)
} }
// New creates a new error based on message. // New creates a new error based on message. Wrapped so that this package does
func New(message string) error { // not appear in the stack trace.
return errors.New(message) var New = errors.New
}
// Errorf creates an error based on a format string and values. // Errorf creates an error based on a format string and values. Wrapped so that
func Errorf(format string, args ...interface{}) error { // this package does not appear in the stack trace.
return errors.Errorf(format, args...) var Errorf = errors.Errorf
}
// Wrap wraps an error retrieved from outside of restic. // Wrap wraps an error retrieved from outside of restic. Wrapped so that this
func Wrap(err error, message string) error { // package does not appear in the stack trace.
return errors.Wrap(err, message) var Wrap = errors.Wrap
}