Exception API
jukto.exceptions
Custom exception hierarchy for Jukto SDK.
Normalized exceptions for recognized SDK and logistics/SMS provider failures. Unknown provider codes remain generic; internal programming errors can escape.
InsufficientBalanceError
Bases: ProviderError
Raised when account balance or credits are depleted.
Source code in src/jukto/exceptions.py
InvalidRequestError
Bases: ProviderError
Raised when provider rejects request due to invalid parameters (e.g. HTTP 400/422).
Source code in src/jukto/exceptions.py
JuktoConfigurationError
Bases: JuktoError
Raised when SDK configuration or credentials are missing or invalid.
Examples:
- API key or secret not provided
- Unsupported provider configuration
Source code in src/jukto/exceptions.py
JuktoError
Bases: Exception
Base exception for recognized, normalized SDK errors.
Catch these errors with except JuktoError:. Internal programming errors
are not universally wrapped and can escape outside this hierarchy.
Source code in src/jukto/exceptions.py
JuktoValidationError
Bases: JuktoError
Raised when client-side validation fails before sending a request.
Examples:
- Empty required shipment phone string (no numbering-plan validation)
- Missing required parcel or order fields
- Negative COD amount
Source code in src/jukto/exceptions.py
ProviderAuthenticationError
Bases: ProviderError
Raised when provider rejects credentials (e.g. HTTP 401/403 or invalid token).
Source code in src/jukto/exceptions.py
ProviderConnectionError
Bases: ProviderError
Raised when a network failure prevents reaching the provider.
Source code in src/jukto/exceptions.py
ProviderError
Bases: JuktoError
Base exception for errors returned by upstream third-party service providers.
Source code in src/jukto/exceptions.py
ProviderRateLimitError
Bases: ProviderError
Raised when an API rate limit is exceeded (e.g. HTTP 429).
Source code in src/jukto/exceptions.py
ProviderServerError
Bases: ProviderError
Raised when an upstream provider fails with a 5xx server error.
Source code in src/jukto/exceptions.py
ProviderTimeoutError
Bases: ProviderConnectionError
Raised when a request to a provider times out.
Source code in src/jukto/exceptions.py
ResourceNotFoundError
Bases: ProviderError
Raised when a requested resource (consignment ID, order, etc.) is not found (e.g. HTTP 404).
Source code in src/jukto/exceptions.py
SMSBatchError
Bases: ProviderError
Batch contains failed or unknown entries; inspect results before retrying.
Source code in src/jukto/exceptions.py
UnexpectedProviderResponseError
Bases: ProviderError
Upstream decoding/schema failure; a side effect may already have happened.