Skip to content

Exceptions

Idempotency errors

CLASS DESCRIPTION
BaseError

Base error class that overwrites the way exception and extra information is printed.

IdempotencyAlreadyInProgressError

Execution with idempotency key is already in progress

IdempotencyInconsistentStateError

State is inconsistent across multiple requests to persistence store

IdempotencyInvalidStatusError

An invalid status was provided

IdempotencyItemAlreadyExistsError

Item attempting to be inserted into persistence store already exists and is not expired

IdempotencyItemNotFoundError

Item does not exist in persistence store

IdempotencyKeyError

Payload does not contain an idempotent key

IdempotencyModelTypeError

Model type does not match expected payload output

IdempotencyNoSerializationModelError

No model was supplied to the serializer

IdempotencyPersistenceConfigError

The idempotency persistency configuration was unsupported

IdempotencyPersistenceConnectionError

Idempotency persistence connection error

IdempotencyPersistenceConsistencyError

Idempotency persistency consistency error, needs to be removed

IdempotencyPersistenceLayerError

Unrecoverable error from the data store

IdempotencyValidationError

Payload does not match stored idempotency record

BaseError

BaseError(*args: str | Exception | None)

Bases: Exception

Base error class that overwrites the way exception and extra information is printed. See https://github.com/aws-powertools/powertools-lambda-python/issues/1772

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyAlreadyInProgressError

IdempotencyAlreadyInProgressError(
    *args: str | Exception | None,
)

Bases: BaseError

Execution with idempotency key is already in progress

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyInconsistentStateError

IdempotencyInconsistentStateError(
    *args: str | Exception | None,
)

Bases: BaseError

State is inconsistent across multiple requests to persistence store

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyInvalidStatusError

IdempotencyInvalidStatusError(
    *args: str | Exception | None,
)

Bases: BaseError

An invalid status was provided

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyItemAlreadyExistsError

IdempotencyItemAlreadyExistsError(
    *args: str | Exception | None,
    old_data_record: DataRecord | None = None
)

Bases: BaseError

Item attempting to be inserted into persistence store already exists and is not expired

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
37
38
39
def __init__(self, *args: str | Exception | None, old_data_record: DataRecord | None = None):
    self.old_data_record = old_data_record
    super().__init__(*args)

IdempotencyItemNotFoundError

IdempotencyItemNotFoundError(*args: str | Exception | None)

Bases: BaseError

Item does not exist in persistence store

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyKeyError

IdempotencyKeyError(*args: str | Exception | None)

Bases: BaseError

Payload does not contain an idempotent key

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyModelTypeError

IdempotencyModelTypeError(*args: str | Exception | None)

Bases: BaseError

Model type does not match expected payload output

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyNoSerializationModelError

IdempotencyNoSerializationModelError(
    *args: str | Exception | None,
)

Bases: BaseError

No model was supplied to the serializer

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyPersistenceConfigError

IdempotencyPersistenceConfigError(
    *args: str | Exception | None,
)

Bases: BaseError

The idempotency persistency configuration was unsupported

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyPersistenceConnectionError

IdempotencyPersistenceConnectionError(
    *args: str | Exception | None,
)

Bases: BaseError

Idempotency persistence connection error

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyPersistenceConsistencyError

IdempotencyPersistenceConsistencyError(
    *args: str | Exception | None,
)

Bases: BaseError

Idempotency persistency consistency error, needs to be removed

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyPersistenceLayerError

IdempotencyPersistenceLayerError(
    *args: str | Exception | None,
)

Bases: BaseError

Unrecoverable error from the data store

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None

IdempotencyValidationError

IdempotencyValidationError(*args: str | Exception | None)

Bases: BaseError

Payload does not match stored idempotency record

Source code in aws_lambda_powertools/utilities/idempotency/exceptions.py
19
20
21
def __init__(self, *args: str | Exception | None):
    self.message = str(args[0]) if args else ""
    self.details = "".join(str(arg) for arg in args[1:]) if args[1:] else None