Exceptions

Errors raised for failed HTTP responses or API error payloads. Implementation module: cleancsv.errors.

class cleancsv.errors.CleanCSVError(message, status_code=None, body=None)[source]

Bases: Exception

Error returned by the CleanCSV API or raised for failed HTTP responses.

Subclass of Exception carrying the HTTP status and response body when available so callers can log or display API error messages.

status_code

HTTP status code if the error came from a response, else None.

body

Raw response body text when available (may be HTML or JSON string).

class cleancsv.errors.RateLimitError(message, *, remaining=None, reset_ms=None, retry_after_s=None, body=None)[source]

Bases: CleanCSVError

Rate limit exceeded (HTTP 429), typically on demo or throttled endpoints.

Extends CleanCSVError with optional metadata from response headers or JSON so clients can back off or retry.

remaining

Remaining quota from X-RateLimit-Remaining or JSON, if parsed.

reset_ms

Reset time in milliseconds from JSON reset, if present.

retry_after_s

Suggested retry delay in seconds from Retry-After, if present.

body

Inherited from CleanCSVError — raw response body text.

status_code

Always 429 for this exception type.