MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / refreshErrorFromError

Function refreshErrorFromError

sdk/cliproxy/auth/conductor.go:3892–3906  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

3890}
3891
3892func refreshErrorFromError(err error) *Error {
3893 if err == nil {
3894 return nil
3895 }
3896 statusCode := statusCodeFromError(err)
3897 if statusCode == 0 && isUnauthorizedError(err) {
3898 statusCode = http.StatusUnauthorized
3899 }
3900 authErr := &Error{Message: err.Error(), HTTPStatus: statusCode}
3901 if statusCode == http.StatusUnauthorized {
3902 authErr.Code = "unauthorized"
3903 authErr.Retryable = false
3904 }
3905 return authErr
3906}
3907
3908func retryAfterFromError(err error) *time.Duration {
3909 if err == nil {

Callers 1

refreshAuthMethod · 0.85

Calls 3

statusCodeFromErrorFunction · 0.85
isUnauthorizedErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected