Skip to content

Commit 803c4f6

Browse files
committed
Extend HTTPError to satisfy the Go 1.13 error wrapper interface
1 parent c08f303 commit 803c4f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

echo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,11 @@ func (he *HTTPError) SetInternal(err error) *HTTPError {
795795
return he
796796
}
797797

798+
// Unwrap satisfies the Go 1.13 error wrapper interface.
799+
func (he *HTTPError) Unwrap() error {
800+
return he.Internal
801+
}
802+
798803
// WrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
799804
func WrapHandler(h http.Handler) HandlerFunc {
800805
return func(c Context) error {

0 commit comments

Comments
 (0)