Exceptions¶
Custom exceptions for DynamoDB error handling.
exceptions ¶
DynanticError ¶
Bases: Exception
Base exception for all Dynantic errors.
Source code in dynantic/exceptions.py
TableNotFoundError ¶
Bases: DynanticError
Raised when the DynamoDB table does not exist.
Source code in dynantic/exceptions.py
ItemNotFoundError ¶
Bases: DynanticError
Raised when an item is not found (for future use with strict gets).
Source code in dynantic/exceptions.py
ConditionalCheckFailedError ¶
Bases: DynanticError
Raised when a conditional write fails.
Source code in dynantic/exceptions.py
ProvisionedThroughputExceededError ¶
ItemCollectionSizeLimitError ¶
Bases: DynanticError
Raised when item collection size exceeds 10GB limit.
Source code in dynantic/exceptions.py
TransactionConflictError ¶
Bases: DynanticError
Raised when a transaction conflicts with another ongoing transaction.
Source code in dynantic/exceptions.py
RequestTimeoutError ¶
Bases: DynanticError
Raised when a request to DynamoDB times out.
Source code in dynantic/exceptions.py
ValidationError ¶
Bases: DynanticError
Raised for data validation errors from DynamoDB.
Source code in dynantic/exceptions.py
DynamoSerializationError ¶
Bases: DynanticError
Raised when serialization to DynamoDB format fails (e.g. unsupported type).
Source code in dynantic/exceptions.py
handle_dynamo_errors ¶
Context manager that catches botocore.exceptions.ClientError and raises the appropriate DynanticError subclass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_name
|
str | None
|
Optional table name for better error messages |
None
|
Usage
with handle_dynamo_errors(table_name="users"): client.get_item(...)