Skip to content

Commit

Permalink
fix: correct unwrap of http2.Error
Browse files Browse the repository at this point in the history
  • Loading branch information
pabigot committed Feb 25, 2022
1 parent 493a0c9 commit 67b369c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/http/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package http

import (
"errors"
"fmt"
"strconv"
)
Expand All @@ -32,7 +31,10 @@ func (e *Error) Error() string {
}

func (e *Error) Unwrap() error {
return errors.New(e.Error())
if e.Err != nil {
return e.Err
}
return nil
}

// NewError returns newly created Error initialised with nested error and default values
Expand Down

0 comments on commit 67b369c

Please sign in to comment.