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

Function IsNeedUserAuthorizationError

internal/auth/errors.go:55–62  ·  view source on GitHub ↗

IsNeedUserAuthorizationError reports whether err represents a missing-UAT failure. It matches the legacy *NeedAuthorizationError sentinel, which is preserved in the Cause chain of the typed missing-UAT error, so errors.As traverses into the typed *errs.AuthenticationError as well.

(err error)

Source from the content-addressed store, hash-verified

53// preserved in the Cause chain of the typed missing-UAT error, so errors.As
54// traverses into the typed *errs.AuthenticationError as well.
55func IsNeedUserAuthorizationError(err error) bool {
56 if err == nil {
57 return false
58 }
59
60 var needAuthErr *NeedAuthorizationError
61 return errors.As(err, &needAuthErr)
62}
63
64// SecurityPolicyError is preserved as a Go type alias so existing
65// errors.As(&SecurityPolicyError{}) consumers (cmd/root.go etc.) keep working.

Callers 1

Calls 1

AsMethod · 0.80

Tested by 1