1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

Remove unused fields from HandlerError

This commit is contained in:
Matthew Holt 2019-10-29 11:59:08 -06:00
parent c4c45f8e01
commit ba0000678d
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
2 changed files with 2 additions and 5 deletions

View file

@ -55,8 +55,6 @@ func Error(statusCode int, err error) HandlerError {
type HandlerError struct {
Err error // the original error value and message
StatusCode int // the HTTP status code to associate with this error
Message string // an optional message that can be shown to the user
Recommendations []string // an optional list of things to try to resolve the error
ID string // generated; for identifying this error in logs
Trace string // produced from call stack

View file

@ -349,7 +349,6 @@ func (*HTTPErrorConfig) WithError(r *http.Request, err error) *http.Request {
if handlerErr, ok := err.(HandlerError); ok {
repl.Set("http.error.status_code", strconv.Itoa(handlerErr.StatusCode))
repl.Set("http.error.status_text", http.StatusText(handlerErr.StatusCode))
repl.Set("http.error.message", handlerErr.Message)
repl.Set("http.error.trace", handlerErr.Trace)
repl.Set("http.error.id", handlerErr.ID)
}