mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
- Add TelecomSDK class with async context manager and aiohttp ClientSession with 30s timeout, 3 retries - Add subscriber management: get_subscriber, list_subscribers with pagination/status filter, create_subscriber, update_subscriber, suspend_subscriber, activate_subscriber, terminate_subscriber - Add usage tracking: get_usage_stats with date range, list_usage_events with filtering, get_real_time_usage
32 lines
599 B
Python
32 lines
599 B
Python
class TelecomError(Exception):
|
|
"""Base exception for all Telecom SDK errors."""
|
|
|
|
def __init__(self, message: str, status_code: Optional[int] = None, response_data: Optional[dict] = None):
|
|
super().__init__(message)
|
|
self.status_code = status_code
|
|
self.response_data = response_data or {}
|
|
|
|
|
|
class AuthenticationError(TelecomError):
|
|
pass
|
|
|
|
|
|
class APIError(TelecomError):
|
|
pass
|
|
|
|
|
|
class NetworkError(TelecomError):
|
|
pass
|
|
|
|
|
|
class ValidationError(TelecomError):
|
|
pass
|
|
|
|
|
|
class RateLimitError(TelecomError):
|
|
pass
|
|
|
|
|
|
class ServerError(TelecomError):
|
|
pass
|