Do not overwrite errors.

pull/752/head
Mariano Cano 3 years ago
parent b6ebd118fc
commit aa3fdf8fb9

@ -246,6 +246,9 @@ func New(status int, format string, args ...interface{}) error {
// NewError creates a new http error with the given error and message.
func NewError(status int, err error, format string, args ...interface{}) error {
if _, ok := err.(*Error); ok {
return err
}
msg := fmt.Sprintf(format, args...)
if _, ok := err.(StackTracer); !ok {
err = errors.Wrap(err, msg)

Loading…
Cancel
Save