mirror of
https://github.com/labstack/echo.git
synced 2025-07-17 01:43:02 +02:00
Capture proxy middleware error
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
@ -17,8 +17,7 @@ func proxyHTTP(tgt *ProxyTarget, c echo.Context, config ProxyConfig) http.Handle
|
||||
if tgt.Name != "" {
|
||||
desc = fmt.Sprintf("%s(%s)", tgt.Name, tgt.URL.String())
|
||||
}
|
||||
c.Logger().Errorf("remote %s unreachable, could not forward: %v", desc, err)
|
||||
c.Error(echo.NewHTTPError(http.StatusServiceUnavailable))
|
||||
c.Set("_error", echo.NewHTTPError(http.StatusBadGateway, fmt.Sprintf("remote %s unreachable, could not forward: %v", desc, err)))
|
||||
}
|
||||
proxy.Transport = config.Transport
|
||||
return proxy
|
||||
|
Reference in New Issue
Block a user