(handler apiHandler, w http.ResponseWriter, r *http.Request)
| 316 | } |
| 317 | |
| 318 | func (a *API) redirectErrors(handler apiHandler, w http.ResponseWriter, r *http.Request) { |
| 319 | ctx := r.Context() |
| 320 | log := getLogEntry(r) |
| 321 | errorID := getRequestID(ctx) |
| 322 | err := handler(w, r) |
| 323 | if err != nil { |
| 324 | q := getErrorQueryString(err, errorID, log) |
| 325 | http.Redirect(w, r, a.getExternalRedirectURL(r)+"#"+q.Encode(), http.StatusFound) |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | func getErrorQueryString(err error, errorID string, log logrus.FieldLogger) *url.Values { |
| 330 | q := url.Values{} |
no test coverage detected