mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-23 03:53:04 +08:00
Remove unused fields from HandlerError
This commit is contained in:
parent
c4c45f8e01
commit
ba0000678d
|
@ -53,10 +53,8 @@ func Error(statusCode int, err error) HandlerError {
|
||||||
// HandlerError is a serializable representation of
|
// HandlerError is a serializable representation of
|
||||||
// an error from within an HTTP handler.
|
// an error from within an HTTP handler.
|
||||||
type HandlerError struct {
|
type HandlerError struct {
|
||||||
Err error // the original error value and message
|
Err error // the original error value and message
|
||||||
StatusCode int // the HTTP status code to associate with this error
|
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
|
ID string // generated; for identifying this error in logs
|
||||||
Trace string // produced from call stack
|
Trace string // produced from call stack
|
||||||
|
|
|
@ -349,7 +349,6 @@ 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", strconv.Itoa(handlerErr.StatusCode))
|
repl.Set("http.error.status_code", strconv.Itoa(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.message", handlerErr.Message)
|
|
||||||
repl.Set("http.error.trace", handlerErr.Trace)
|
repl.Set("http.error.trace", handlerErr.Trace)
|
||||||
repl.Set("http.error.id", handlerErr.ID)
|
repl.Set("http.error.id", handlerErr.ID)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user