from bundleup import BundleUp
from bundleup.exceptions import (
BundleUpError, # Base exception
ValidationError, # Input validation errors
APIError, # General API errors
AuthenticationError, # 401 errors
NotFoundError, # 404 errors
RateLimitError # 429 errors
)
try:
client = BundleUp("your-api-key")
connections = client.connections.list()
except AuthenticationError:
print("Invalid API key")
except NotFoundError:
print("Resource not found")
except RateLimitError:
print("Rate limit exceeded")
except APIError as e:
print(f"API error: {e.status_code} - {e}")
except ValidationError as e:
print(f"Validation error: {e}")