NewNeedUserAuthorizationError builds the typed *errs.AuthenticationError returned when no valid UAT exists for userOpenID. The Message keeps the need_user_authorization marker, the Hint converges on the same auth-login recovery vocabulary as the token-missing surface in internal/client, and the lega
(userOpenID string)
| 41 | // legacy *NeedAuthorizationError sentinel is preserved in the Cause chain for |
| 42 | // errors.As / errors.Is traversal. |
| 43 | func NewNeedUserAuthorizationError(userOpenID string) *errs.AuthenticationError { |
| 44 | return errs.NewAuthenticationError(errs.SubtypeTokenMissing, |
| 45 | "%s (user: %s)", needUserAuthorizationMarker, userOpenID). |
| 46 | WithUserOpenID(userOpenID). |
| 47 | WithHint("run: lark-cli auth login to re-authorize"). |
| 48 | WithCause(&NeedAuthorizationError{UserOpenId: userOpenID}) |
| 49 | } |
| 50 | |
| 51 | // IsNeedUserAuthorizationError reports whether err represents a missing-UAT |
| 52 | // failure. It matches the legacy *NeedAuthorizationError sentinel, which is |