summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/server.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2022-08-23 01:31:07 -0400
committerGitHub <noreply@github.com>2022-08-22 23:31:07 -0600
commit72541f1cb81a97466afcdf0a6164367c499a9f81 (patch)
tree483a35f7e90abc3e99d7a680d3cb1a7873549688 /modules/caddyhttp/server.go
parentfe5f5dfd6aa2f48e92897327c9c7d8c8583a3d72 (diff)
caddyhttp: Set `http.error.message` to the HandlerError message (#4971)
Diffstat (limited to 'modules/caddyhttp/server.go')
-rw-r--r--modules/caddyhttp/server.go3
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