MCPcopy Index your code
hub / github.com/docker/cli / tryDecodeOAuthError

Function tryDecodeOAuthError

internal/oauth/api/api.go:84–92  ·  view source on GitHub ↗
(resp *http.Response)

Source from the content-addressed store, hash-verified

82}
83
84func tryDecodeOAuthError(resp *http.Response) error {
85 var body map[string]any
86 if err := json.NewDecoder(resp.Body).Decode(&body); err == nil {
87 if errorDescription, ok := body["error_description"].(string); ok {
88 return errors.New(errorDescription)
89 }
90 }
91 return errors.New("unexpected response from tenant: " + resp.Status)
92}
93
94// WaitForDeviceToken polls the tenant to get access/refresh tokens for the user.
95// This should be called after GetDeviceCode, and will block until the user has

Callers 2

GetDeviceCodeMethod · 0.85
RevokeTokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…