class APIError(Exception):
"""Base exception for Turbify API errors"""
pass
class APIRetryableError(APIError):
"""Errors that might be resolved by retrying"""
pass
class APINonRetryableError(APIError):
"""Errors that won't be resolved by retrying"""
pass
class ConfigurationError(Exception):
"""Exception raised for configuration errors"""
pass
def handle_api_error(error_code):
"""
Determine if an error is retryable based on the error code
"""
retryable_codes = {
'10600', # Maximum processes reached
'10601', # Store Editor publishing
'10602', # Action in progress
'10500', # Internal error
'10006' # Store not online
}
if error_code in retryable_codes:
return APIRetryableError
return APINonRetryableError