Custom exception types for OAuth workflows.
# Source: https://github.com/lastmile-ai/mcp-agent | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Custom exception types for OAuth workflows."""
class OAuthFlowError(Exception):
"""Base class for OAuth-related failures."""
class AuthorizationDeclined(OAuthFlowError):
"""Raised when the user declines an authorization request."""
class CallbackTimeoutError(OAuthFlowError):
"""Raised when the delegated authorization callback is not received in time."""
class TokenRefreshError(OAuthFlowError):
"""Raised when refreshing an access token fails irrecoverably."""
class MissingUserIdentityError(OAuthFlowError):
"""Raised when an OAuth flow is attempted witho
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key