Introduce an admin portal (React + Nginx), WebSocket routing, and API versioning middleware with `/api/v1/` prefix deprecation. Add master API key authentication, new Prometheus metrics for AI token consumption and active WebSockets, and extend S3 config with a public endpoint URL. Update test paths and fixtures to align with the new routing structure.
26 lines
787 B
Python
26 lines
787 B
Python
"""
|
|
Exceptions for the Imago Client SDK.
|
|
"""
|
|
|
|
class ImagoError(Exception):
|
|
"""Base exception for all Imago SDK errors."""
|
|
|
|
class AuthError(ImagoError):
|
|
"""Raised when authentication fails (401)."""
|
|
|
|
class QuotaError(ImagoError):
|
|
"""Raised when quota limits are reached (429 or 403 quota)."""
|
|
|
|
class NotFoundError(ImagoError):
|
|
"""Raised when a requested resource is not found (404)."""
|
|
|
|
class APIError(ImagoError):
|
|
"""Raised when the API returns an unexpected error."""
|
|
def __init__(self, message: str, status_code: int = None, details: dict = None):
|
|
super().__init__(message)
|
|
self.status_code = status_code
|
|
self.details = details or {}
|
|
|
|
class PipelineError(ImagoError):
|
|
"""Raised when an error occurs in the AI processing pipeline."""
|