diff options
author | Francis Lavoie <lavofr@gmail.com> | 2022-08-23 01:31:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 23:31:07 -0600 |
commit | 72541f1cb81a97466afcdf0a6164367c499a9f81 (patch) | |
tree | 483a35f7e90abc3e99d7a680d3cb1a7873549688 /modules/caddyhttp | |
parent | fe5f5dfd6aa2f48e92897327c9c7d8c8583a3d72 (diff) |
caddyhttp: Set `http.error.message` to the HandlerError message (#4971)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r-- | modules/caddyhttp/server.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index f8cd612..73e1475 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -526,8 +526,9 @@ func (*HTTPErrorConfig) WithError(r *http.Request, err error) *http.Request { if handlerErr, ok := err.(HandlerError); ok { repl.Set("http.error.status_code", 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.trace", handlerErr.Trace) + repl.Set("http.error.message", handlerErr.Err.Error()) } return r |