1
0
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:
Jonathan Hall 2020-04-29 16:13:30 +02:00
parent c08f30359b
commit 803c4f673b

View File

@ -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 {