control plane: add request id to all error pages (#2149)

* controlplane: add request id to all error pages

- use a single http error handler for both envoy and go control plane
- add http lib style status text for our custom statuses.

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
bobby 2021-04-28 15:04:44 -07:00 committed by GitHub
parent 91c7dc742f
commit 9215833a0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 126 additions and 136 deletions

View file

@ -59,7 +59,7 @@ func (f HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if err := f(w, r); err != nil {
var e *HTTPError
if !errors.As(err, &e) {
e = &HTTPError{http.StatusInternalServerError, err}
e = &HTTPError{Status: http.StatusInternalServerError, Err: err}
}
e.ErrorResponse(w, r)
}