Problem
TokenManagerError wraps untyped any Error in two cases:
authenticationFailed(underlying: (any Error)?)
networkError(underlying: any Error)
This forces callers to use as? casting to inspect underlying errors, reducing ergonomics and type safety.
Suggested Fix
Replace any Error with specific typed errors (e.g., CloudKitError, URLError) or introduce a dedicated error enum for underlying causes. This would allow pattern matching without casting and improve consistency with the rest of the API surface, which uses typed throws.
🤖 Generated with Claude Code
Problem
TokenManagerErrorwraps untypedany Errorin two cases:authenticationFailed(underlying: (any Error)?)networkError(underlying: any Error)This forces callers to use
as?casting to inspect underlying errors, reducing ergonomics and type safety.Suggested Fix
Replace
any Errorwith specific typed errors (e.g.,CloudKitError,URLError) or introduce a dedicated error enum for underlying causes. This would allow pattern matching without casting and improve consistency with the rest of the API surface, which uses typed throws.🤖 Generated with Claude Code