Overview
All Valiqor exceptions inherit fromValiqorError. Catch this base class to handle any SDK error, or catch specific subclasses for granular error handling.
Exception Hierarchy
Base Exception
ValiqorError
Base class for all Valiqor SDK errors.
Authentication Errors
ConfigurationError
Raised when the SDK is misconfigured — missing API key, invalid config file, or incompatible settings.
| Common Cause | Resolution |
|---|---|
| Missing API key | Set VALIQOR_API_KEY env var or pass api_key to client |
Invalid .valiqorrc | Check JSON syntax in your config file |
| Missing project name | Set VALIQOR_PROJECT_NAME or pass project_name |
AuthenticationError
Raised when the API key is invalid, expired, or unauthorized.
| Common Cause | Resolution |
|---|---|
| Invalid API key | Regenerate at dashboard or valiqor keys create |
| Expired key | Create a new key |
| Wrong org | Check you’re using the correct key for your org |
AccountDeactivatedError
Raised when the account has been deactivated.
Rate & Quota Errors
RateLimitError
Raised when too many requests are sent in a short period.
| Attribute | Type | Description |
|---|---|---|
retry_after | Optional[int] | Seconds to wait before retrying. |
| Resolution |
|---|
Wait for retry_after seconds, then retry. Consider adding backoff logic. |
QuotaExceededError
Raised when monthly usage quota is reached.
| Attribute | Type | Description |
|---|---|---|
current_usage | Optional[int] | Current usage count. |
quota_limit | Optional[int] | Maximum allowed. |
service | Optional[str] | Which service hit the limit (e.g. "evaluation"). |
TokenQuotaExceededError
Raised when token usage quota is exceeded (subclass of QuotaExceededError).
| Attribute | Type | Description |
|---|---|---|
current_tokens | Optional[int] | Tokens used so far. |
predicted_tokens | Optional[int] | Predicted tokens for the request. |
token_limit | Optional[int] | Token quota limit. |
Validation Errors
ValidationError
Raised when input data fails validation — bad format, missing fields, or invalid parameters.
| Common Cause | Resolution |
|---|---|
| Missing required fields | Ensure dataset items have input and output |
| Invalid metric name | Check list_metric_templates() for valid keys |
| Invalid parameter value | Check parameter docs for accepted values |
DatasetTooLargeError
Raised when the dataset exceeds the maximum allowed size.
| Attribute | Type | Description |
|---|---|---|
dataset_size | Optional[int] | Number of items in the dataset. |
max_allowed | Optional[int] | Maximum allowed items. |
| Resolution |
|---|
| Split dataset into smaller batches, or use async mode. |
Network & Timeout Errors
TimeoutError
Raised when a request exceeds the timeout duration.
| Resolution |
|---|
Increase timeout parameter, or use async mode for large datasets. |
NetworkError
Raised when the SDK cannot reach the backend.
| Common Cause | Resolution |
|---|---|
| No internet connection | Check connectivity |
| Backend URL incorrect | Verify VALIQOR_BACKEND_URL |
| DNS resolution failure | Check firewall/proxy settings |
UploadError
Raised when a trace or scan upload fails (subclass of NetworkError).
API Errors
APIError
Generic API error with status code and response details.
| Attribute | Type | Description |
|---|---|---|
status_code | Optional[int] | HTTP status code. |
response | Optional[dict] | Full response body. |
ServiceUnavailableError
Raised when the backend is temporarily unavailable (503).
| Attribute | Type | Description |
|---|---|---|
retry_after | Optional[int] | Seconds to wait before retrying. |
Module-Specific Errors
TracingError
Raised for errors during trace capture or export.
ScanError
Raised for errors during code scanning.
EvaluationError
Raised for errors during evaluation runs.
SecurityError
Raised for errors during security audits or red team runs.
Error Handling Pattern
Related
- Troubleshooting — Common issues and fixes
- Configuration — Avoid
ConfigurationError - Rate Limits — Understand rate and quota limits