MCPcopy
hub / github.com/larksuite/cli / newTokenMissingError

Function newTokenMissingError

internal/client/client.go:73–78  ·  view source on GitHub ↗

newTokenMissingError builds the typed *errs.AuthenticationError that resolveAccessToken returns when no usable token is available for the requested identity. cause is the underlying credential-chain error (or nil for the defensive empty-token branch) and is preserved for errors.Is / errors.Unwrap tr

(as core.Identity, cause error)

Source from the content-addressed store, hash-verified

71// for the defensive empty-token branch) and is preserved for errors.Is /
72// errors.Unwrap traversal without being serialized on the wire.
73func newTokenMissingError(as core.Identity, cause error) error {
74 return errs.NewAuthenticationError(errs.SubtypeTokenMissing,
75 "no access token available for %s", as).
76 WithHint("run: lark-cli auth login to re-authorize").
77 WithCause(cause)
78}
79
80// buildApiReq converts a RawApiRequest into SDK types and collects
81// request-specific options (ExtraOpts, URL-based headers).

Callers 1

resolveAccessTokenMethod · 0.85

Calls 3

NewAuthenticationErrorFunction · 0.92
WithCauseMethod · 0.45
WithHintMethod · 0.45

Tested by

no test coverage detected