mirror of https://github.com/caddyserver/caddy.git
caddyhttp: Set `http.error.message` to the HandlerError message (#4971)
This commit is contained in:
parent
fe5f5dfd6a
commit
72541f1cb8
|
@ -526,8 +526,9 @@ func (*HTTPErrorConfig) WithError(r *http.Request, err error) *http.Request {
|
||||||
if handlerErr, ok := err.(HandlerError); ok {
|
if handlerErr, ok := err.(HandlerError); ok {
|
||||||
repl.Set("http.error.status_code", handlerErr.StatusCode)
|
repl.Set("http.error.status_code", handlerErr.StatusCode)
|
||||||
repl.Set("http.error.status_text", http.StatusText(handlerErr.StatusCode))
|
repl.Set("http.error.status_text", http.StatusText(handlerErr.StatusCode))
|
||||||
repl.Set("http.error.trace", handlerErr.Trace)
|
|
||||||
repl.Set("http.error.id", handlerErr.ID)
|
repl.Set("http.error.id", handlerErr.ID)
|
||||||
|
repl.Set("http.error.trace", handlerErr.Trace)
|
||||||
|
repl.Set("http.error.message", handlerErr.Err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Reference in New Issue