mirror of
https://github.com/labstack/echo.git
synced 2025-07-13 01:30:31 +02:00
Extend HTTPError to satisfy the Go 1.13 error wrapper interface
This commit is contained in:
5
echo.go
5
echo.go
@ -795,6 +795,11 @@ func (he *HTTPError) SetInternal(err error) *HTTPError {
|
|||||||
return he
|
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`.
|
// WrapHandler wraps `http.Handler` into `echo.HandlerFunc`.
|
||||||
func WrapHandler(h http.Handler) HandlerFunc {
|
func WrapHandler(h http.Handler) HandlerFunc {
|
||||||
return func(c Context) error {
|
return func(c Context) error {
|
||||||
|
Reference in New Issue
Block a user