mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Extend HTTPError to satisfy the Go 1.13 error wrapper interface
This commit is contained in:
parent
c08f30359b
commit
803c4f673b
5
echo.go
5
echo.go
@ -795,6 +795,11 @@ func (he *HTTPError) SetInternal(err error) *HTTPError {
|
||||
return he
|
||||
}
|
||||
|
||||
// Unwrap satisfies the Go 1.13 error wrapper interface.
|
||||
func (he *HTTPError) Unwrap() error {
|
||||
return he.Internal
|
||||
}
|
||||
|
||||
// WrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
|
||||
func WrapHandler(h http.Handler) HandlerFunc {
|
||||
return func(c Context) error {
|
||||
|
Loading…
Reference in New Issue
Block a user