ErrorHandler lets you call an alternate http handler upon a certain response code. Note it will assume a 200 if the wrapped handler does not write anything
| 20 | // ErrorHandler lets you call an alternate http handler upon a certain response code. |
| 21 | // Note it will assume a 200 if the wrapped handler does not write anything |
| 22 | type ErrorHandler struct { |
| 23 | Code int |
| 24 | Handler http.Handler |
| 25 | } |
| 26 | |
| 27 | // Wrap implements Middleware |
| 28 | func (e ErrorHandler) Wrap(next http.Handler) http.Handler { |
nothing calls this directly
no outgoing calls
no test coverage detected