MCPcopy Create free account
hub / github.com/cli/cli / warnRefreshFailed

Method warnRefreshFailed

internal/config/refreshable.go:599–604  ·  view source on GitHub ↗

warnRefreshFailed warns that refreshing the expiring token failed with err and the current token is used as is. Callers of the refreshing token methods drop the returned error, so without it the user would only see the generic HTTP 401 the stale token eventually earns.

(hostname, username string, err error)

Source from the content-addressed store, hash-verified

597// Callers of the refreshing token methods drop the returned error, so without it the user would only see the generic
598// HTTP 401 the stale token eventually earns.
599func (c *AuthConfig) warnRefreshFailed(hostname, username string, err error) {
600 c.addWarning(fmt.Sprintf(
601 "Could not refresh the token of account %s on %s: %v. "+
602 "The token has expired or is about to expire, so requests may fail until a refresh succeeds.",
603 username, hostname, err))
604}
605
606// refreshRejectionRecheckDelays are the pauses before each re-read in credentialRotatedByPeer. The first re-read is
607// immediate; the later ones give a peer that spent the same refresh token moments earlier time to finish storing its

Callers 1

Calls 1

addWarningMethod · 0.95

Tested by

no test coverage detected