UNPKG

@aws-lambda-powertools/idempotency

Version:

The idempotency package for the Powertools for AWS Lambda (TypeScript) library. It provides options to make your Lambda functions idempotent and safe to retry.

68 lines 2.78 kB
import type { IdempotencyRecord } from './persistence/IdempotencyRecord.js'; /** * Base error for idempotency errors. * * Generally this error should not be thrown directly unless you are throwing a generic and unknown error. */ declare class IdempotencyUnknownError extends Error { constructor(message?: string, options?: ErrorOptions); } /** * Item attempting to be inserted into persistence store already exists and is not expired */ declare class IdempotencyItemAlreadyExistsError extends IdempotencyUnknownError { existingRecord?: IdempotencyRecord; constructor(message?: string, existingRecord?: IdempotencyRecord, options?: ErrorOptions); } /** * Item does not exist in persistence store */ declare class IdempotencyItemNotFoundError extends IdempotencyUnknownError { constructor(message?: string, options?: ErrorOptions); } /** * Execution with idempotency key is already in progress */ declare class IdempotencyAlreadyInProgressError extends IdempotencyUnknownError { existingRecord?: IdempotencyRecord; constructor(message?: string, existingRecord?: IdempotencyRecord, options?: ErrorOptions); } /** * An invalid status was provided */ declare class IdempotencyInvalidStatusError extends IdempotencyUnknownError { constructor(message?: string, options?: ErrorOptions); } /** * Payload does not match stored idempotency record */ declare class IdempotencyValidationError extends IdempotencyUnknownError { existingRecord?: IdempotencyRecord; constructor(message?: string, existingRecord?: IdempotencyRecord, options?: ErrorOptions); } /** * State is inconsistent across multiple requests to persistence store */ declare class IdempotencyInconsistentStateError extends IdempotencyUnknownError { constructor(message?: string, options?: ErrorOptions); } /** * Unrecoverable error from the data store */ declare class IdempotencyPersistenceLayerError extends IdempotencyUnknownError { constructor(message: string, options?: ErrorOptions); } /** * Payload does not contain an idempotent key */ declare class IdempotencyKeyError extends IdempotencyUnknownError { constructor(message?: string, options?: ErrorOptions); } /** * Error with the persistence layer's consistency, needs to be removed */ declare class IdempotencyPersistenceConsistencyError extends IdempotencyUnknownError { constructor(message: string, options?: ErrorOptions); } export { IdempotencyUnknownError, IdempotencyItemAlreadyExistsError, IdempotencyItemNotFoundError, IdempotencyAlreadyInProgressError, IdempotencyInvalidStatusError, IdempotencyValidationError, IdempotencyInconsistentStateError, IdempotencyPersistenceLayerError, IdempotencyPersistenceConsistencyError, IdempotencyKeyError, }; //# sourceMappingURL=errors.d.ts.map