Exceptions#

exception ccat_data_transfer.exceptions.CCATDataOperationError(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#

Bases: Exception

Base exception for all CCAT data operations.

__init__(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#
exception ccat_data_transfer.exceptions.ScheduleError(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#

Bases: CCATDataOperationError

Error scheduling a task.

exception ccat_data_transfer.exceptions.NetworkError(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#

Bases: CCATDataOperationError

Network connectivity errors.

exception ccat_data_transfer.exceptions.StorageError(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#

Bases: CCATDataOperationError

Storage-related errors (disk full, permission issues, etc.)

exception ccat_data_transfer.exceptions.SourceMissingError(message, *, step=None, side=None, path=None, host=None, diagnosis=None, operation_id=None)[source]#

Bases: StorageError

A required source file/path was missing or unreadable at a boundary.

Raised by ensure_readable (see boundary.py) in place of the bare FileNotFoundError that several filesystem touch-points used to leak. It carries the Tier-2 error_context breadcrumb fields (where/why) as attributes so the failure hook can lift them into the structured error_context (#118). See docs/adr/0002-filesystem-boundary-errors.md and CONTEXT.md.

is_retryable is forced to False: the bare FileNotFoundError this replaces was non-retryable (should_retry hard-codes it so), and StorageError would otherwise default to retryable. This issue is breadcrumbs only — it must NOT change retry behavior.

__init__(message, *, step=None, side=None, path=None, host=None, diagnosis=None, operation_id=None)[source]#
exception ccat_data_transfer.exceptions.DataCorruptionError(message, operation_id=None)[source]#

Bases: CCATDataOperationError

Data integrity or corruption errors.

__init__(message, operation_id=None)[source]#
exception ccat_data_transfer.exceptions.ArchiveError(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#

Bases: CCATDataOperationError

Errors during archiving operations.

exception ccat_data_transfer.exceptions.PackageError(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#

Bases: CCATDataOperationError

Errors in package creation or manipulation.

exception ccat_data_transfer.exceptions.DeletionError(message, operation_id=None, is_retryable=True, max_retries=3, context=None)[source]#

Bases: CCATDataOperationError

Errors during deletion operations.

exception ccat_data_transfer.exceptions.PermanentError(message, operation_id=None)[source]#

Bases: CCATDataOperationError

Errors that should not be retried.

__init__(message, operation_id=None)[source]#
exception ccat_data_transfer.exceptions.OperationNotFoundError(message, operation_id=None)[source]#

Bases: CCATDataOperationError

The operation row addressed by a task does not exist.

Raised when a task is dispatched with an operation id that resolves to no row (a dangling or mis-addressed id – e.g. a stale task message that names an id belonging to a different operation kind). This is a permanent state: a missing row never reappears, so retrying only loops forever.

is_retryable is forced to False (mirroring PermanentError): the base task’s should_retry otherwise defaults an unrecognised exception to retryable, which turned a dangling id into an infinite retry loop. The dedicated name (over reusing PermanentError) makes the dangling-id cause self-evident in logs and tracebacks.

__init__(message, operation_id=None)[source]#
exception ccat_data_transfer.exceptions.ServiceUnavailableError(message, operation_id=None, max_retries=5)[source]#

Bases: CCATDataOperationError

Temporary service unavailability.

__init__(message, operation_id=None, max_retries=5)[source]#
exception ccat_data_transfer.exceptions.ServiceExit[source]#

Bases: Exception

Custom exception which is used to trigger the clean exit of all running threads and the main program.

exception ccat_data_transfer.exceptions.NoSecondaryRoutesError[source]#

Bases: Exception

exception ccat_data_transfer.exceptions.DatabaseOperationError[source]#

Bases: Exception

exception ccat_data_transfer.exceptions.DataTransferError(message: str, transfer_id: int | None = None)[source]#

Bases: CCATDataOperationError

Base exception for all data transfer errors

__init__(message: str, transfer_id: int | None = None)[source]#
exception ccat_data_transfer.exceptions.BBCPError(message: str, returncode: int, stderr: str, transfer_id: int | None = None)[source]#

Bases: DataTransferError

BBCP specific errors

__init__(message: str, returncode: int, stderr: str, transfer_id: int | None = None)[source]#
exception ccat_data_transfer.exceptions.DestinationFileExistsError(message: str, returncode: int, stderr: str, transfer_id: int | None = None, destination_path: str | None = None)[source]#

Bases: BBCPError

Error when destination file already exists and needs to be removed before retry.

__init__(message: str, returncode: int, stderr: str, transfer_id: int | None = None, destination_path: str | None = None)[source]#
exception ccat_data_transfer.exceptions.SegmentationFaultError(message: str, returncode: int, stderr: str, transfer_id: int | None = None)[source]#

Bases: BBCPError

Segmentation fault error

__init__(message: str, returncode: int, stderr: str, transfer_id: int | None = None)[source]#
exception ccat_data_transfer.exceptions.ConfigurationError(message: str, transfer_id: int | None = None)[source]#

Bases: DataTransferError

Configuration/setup related errors

exception ccat_data_transfer.exceptions.DatabaseError(message: str, original_error: Exception, transfer_id: int | None = None)[source]#

Bases: DataTransferError

Database related errors

__init__(message: str, original_error: Exception, transfer_id: int | None = None)[source]#
exception ccat_data_transfer.exceptions.RetryableError(message: str, transfer_id: int | None = None, max_retries: int = 3)[source]#

Bases: DataTransferError

Base class for errors that can be retried

__init__(message: str, transfer_id: int | None = None, max_retries: int = 3)[source]#
exception ccat_data_transfer.exceptions.NonRetryableError(message: str, transfer_id: int | None = None)[source]#

Bases: DataTransferError

Base class for errors that should not be retried

exception ccat_data_transfer.exceptions.ArchiveCreationError(message: str, transfer_id: int | None = None)[source]#

Bases: DataTransferError

Error during archive creation

exception ccat_data_transfer.exceptions.UnpackError(message: str, transfer_id: int | None = None)[source]#

Bases: DataTransferError

Error during unpacking

exception ccat_data_transfer.exceptions.ChecksumVerificationError(message: str, transfer_id: int | None = None)[source]#

Bases: DataTransferError

Checksum verification error

exception ccat_data_transfer.exceptions.ArchiveCorruptionError(message: str, archive_path: str, transfer_id: int | None = None)[source]#

Bases: DataTransferError

Error indicating a corrupted or incomplete archive file.

__init__(message: str, archive_path: str, transfer_id: int | None = None)[source]#

Overview#

Custom exception classes for error handling in the data transfer system.

Key Components#

  • Custom exception hierarchy

  • Error handling patterns

  • Exception logging and reporting