core: Remove TCP details from connection reset message
This commit is contained in:
parent
85a26150a3
commit
8242b4dfb5
|
@ -815,6 +815,13 @@ func (handler *UnroutedHandler) sendError(w http.ResponseWriter, r *http.Request
|
||||||
err = errors.New("read tcp: i/o timeout")
|
err = errors.New("read tcp: i/o timeout")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Errors for connnection resets also contain TCP details, we don't need, e.g:
|
||||||
|
// read tcp 127.0.0.1:1080->127.0.0.1:10023: read: connection reset by peer
|
||||||
|
// Therefore, we also trim those down.
|
||||||
|
if strings.HasSuffix(err.Error(), "read: connection reset by peer") {
|
||||||
|
err = errors.New("read tcp: connection reset by peer")
|
||||||
|
}
|
||||||
|
|
||||||
statusErr, ok := err.(HTTPError)
|
statusErr, ok := err.(HTTPError)
|
||||||
if !ok {
|
if !ok {
|
||||||
statusErr = NewHTTPError(err, http.StatusInternalServerError)
|
statusErr = NewHTTPError(err, http.StatusInternalServerError)
|
||||||
|
|
Loading…
Reference in New Issue