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:
ExceptionError returned by the CleanCSV API or raised for failed HTTP responses.
Subclass of
Exceptioncarrying 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:
CleanCSVErrorRate limit exceeded (HTTP 429), typically on demo or throttled endpoints.
Extends
CleanCSVErrorwith optional metadata from response headers or JSON so clients can back off or retry.- remaining¶
Remaining quota from
X-RateLimit-Remainingor 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
429for this exception type.