RetrieveError retrieves the error from the context.
(r *http.Request)
| 82 | |
| 83 | // RetrieveError retrieves the error from the context. |
| 84 | func RetrieveError(r *http.Request) error { |
| 85 | if err, ok := r.Context().Value(errorKey).(error); ok { |
| 86 | return err |
| 87 | } |
| 88 | return nil |
| 89 | } |
| 90 | |
| 91 | // Error writes the error to the response writer. |
| 92 | func Error(w http.ResponseWriter, r *http.Request, err error) { |