MCPcopy Create free account
hub / github.com/netlify/gotrue / getErrorQueryString

Function getErrorQueryString

api/external.go:329–357  ·  view source on GitHub ↗
(err error, errorID string, log logrus.FieldLogger)

Source from the content-addressed store, hash-verified

327}
328
329func getErrorQueryString(err error, errorID string, log logrus.FieldLogger) *url.Values {
330 q := url.Values{}
331 switch e := err.(type) {
332 case *HTTPError:
333 if str, ok := oauthErrorMap[e.Code]; ok {
334 q.Set("error", str)
335 } else {
336 q.Set("error", "server_error")
337 }
338 if e.Code >= http.StatusInternalServerError {
339 e.ErrorID = errorID
340 // this will get us the stack trace too
341 log.WithError(e.Cause()).Error(e.Error())
342 } else {
343 log.WithError(e.Cause()).Info(e.Error())
344 }
345 q.Set("error_description", e.Message)
346 case *OAuthError:
347 q.Set("error", e.Err)
348 q.Set("error_description", e.Description)
349 log.WithError(e.Cause()).Info(e.Error())
350 case ErrorCause:
351 return getErrorQueryString(e.Cause(), errorID, log)
352 default:
353 q.Set("error", "server_error")
354 q.Set("error_description", err.Error())
355 }
356 return &q
357}
358
359func (a *API) getExternalRedirectURL(r *http.Request) string {
360 ctx := r.Context()

Callers 1

redirectErrorsMethod · 0.85

Calls 2

CauseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…