Skip to main content

exceptions

Custom exceptions for the federated package.

Classes

AggregatorError

class AggregatorError(*args, **kwargs):

Error related to Aggregator classes.

Ancestors

AlgorithmError

class AlgorithmError(*args, **kwargs):

Error raised during a worker-side algorithm run.

Ancestors

BatchResilienceAbortError

class BatchResilienceAbortError(    error_message: str,    consecutive_failures: Optional[int] = None,    failed_batches: Optional[dict[int, Exception]] = None,):

Error raised when batch resilience system aborts due to consecutive failures.

Arguments

  • error_message: Description of why the task was aborted.
  • consecutive_failures: Number of consecutive failures that triggered abort.
  • failed_batches: Dictionary mapping batch numbers to their exceptions.

Ancestors

BitfountTaskStartError

class BitfountTaskStartError(*args, **kwargs):

Raised when an issue occurs whilst trying to start a task with pods.

Ancestors

CancellationStatus

class CancellationStatus(*args, **kwds):

Outcome of a user-initiated cancellation request.

Ancestors

Variables

  • static CONFIRMED
  • static NO_WORKERS
  • static PARTIAL

DPNotAppliedError

class DPNotAppliedError(*args, **kwargs):

Error if DP could not be applied to a model.

Ancestors

DPParameterError

class DPParameterError(*args, **kwargs):

Error if any of given dp params are not allowed.

Ancestors

DataProcessingError

class DataProcessingError(*args, **kwargs):

Error related to data processing.

This is distinct from DataSourceError, as it is related to later processing of the data. Raised by the ophthalmology algorithms.

Ancestors

EHRConnectionError

class EHRConnectionError(failed_patients: int):

Raised when the EHR repeatedly rejects authenticated requests.

This indicates that token refreshes succeed but the EHR server keeps returning authentication errors (401/403) across multiple patients, suggesting a systemic connectivity or permissions problem.

Ancestors

EHROrchestratorError

class EHROrchestratorError(status_code: int, response_text: str):

Raised when the EHR token endpoint in orchestrator is unreachable/failing.

EHRTokenError

class EHRTokenError(error: str, error_type: EHRTokenErrorType):

Raised when the app is unable to provide a valid EHR token.

This exception is raised in the pod process when unrecoverable token errors are encountered (e.g. EHR is down, internal app errors) or when the retry budget for network errors has been exhausted.

Ancestors

EHRTokenErrorType

class EHRTokenErrorType(*args, **kwds):

Types of errors that can occur when requesting an EHR token from the app.

Ancestors

Variables

  • static EHR_ERROR - The EHR rejected the token request. Do not retry.
  • static INTERNAL_ERROR - An unexpected error occurred in the app. Do not retry.
  • static NETWORK_ERROR - The app could not reach the EHR. Retry for a while before giving up.

MessageHandlerDispatchError

class MessageHandlerDispatchError(*args, **kwargs):

Error raised when there is a problem dispatching messages to handlers.

Ancestors

MessageHandlerNotFoundError

class MessageHandlerNotFoundError(*args, **kwargs):

Error raised when no registered message handler can be found.

MessageRetrievalError

class MessageRetrievalError(*args, **kwargs):

Raised when an error occurs whilst retrieving a message from message service.

Ancestors

MessageTypeSpecificHandlerNotFoundError

class MessageTypeSpecificHandlerNotFoundError(*args, **kwargs):

Error raised when no non-universal registered message handler can be found.

Variables

  • static universal_dispatches : list[Union[ConcurrentFuture, _PriorityHandler]]

NoDataError

class NoDataError(*args, **kwargs):

Error when no data is found.

Ancestors

NoNewDataError

class NoNewDataError(*args, **kwargs):

Error when run_on_new_data_only is True but no new records are found.

Ancestors

OrchestratorTokenEndpointError

class OrchestratorTokenEndpointError(    status_code: int, response_text: str, token_type: str,):

Raised when the orchestrator token endpoint is unreachable or failing.

This represents persistent non-200 responses from the local orchestrator HTTP token endpoint, independent of token type (oauth/ehr).

Ancestors

PodConnectFailedError

class PodConnectFailedError(*args, **kwargs):

The message service has not correctly connected the pod.

Ancestors

PodNameError

class PodNameError(*args, **kwargs):

Error related to given Pod name.

Ancestors

PodRegistrationError

class PodRegistrationError(*args, **kwargs):

Error related to registering a Pod with BitfountHub.

Ancestors

PodResponseError

class PodResponseError(*args, **kwargs):

Pod rejected or failed to respond to a task request.

Ancestors

PrivateSqlError

class PrivateSqlError(*args, **kwargs):

An exception for any issues relating to the PrivateSQL algorithm.

Ancestors

ProtocolError

class ProtocolError(*args, **kwargs):

Error raised during protocol run.

Ancestors

TaskAbortError

class TaskAbortError(    error_message: str,    reason: Optional[Reason] = None,    message_already_sent: bool = False,):

Error raised when a TASK_ABORT is received from a pod.

Initialises TaskAbortError.

Arguments

  • error_message: Describes the reason for the task being aborted.
  • reason: Machine-reasable reason for the task being aborted.
  • message_already_sent: Whether a message has already been sent to the "other side" (i.e. modeller or pod) of the task run, or whether a TASK_ABORT message still needs to be sent.

Ancestors

Subclasses

TaskCancelled

class TaskCancelled(    error_message: str,    cancellation_status: CancellationStatus,    reason: Optional[Reason] = Reason.CANCELLED_BY_MODELLER,):

Raised when a task is cancelled by the user.

Subclass of TaskAbortError so existing abort handling still catches it, while allowing callers to distinguish a user-initiated cancellation from a worker-initiated abort.

Initialises TaskAbortError.

Arguments

  • error_message: Describes the reason for the task being aborted.
  • reason: Machine-reasable reason for the task being aborted.
  • message_already_sent: Whether a message has already been sent to the "other side" (i.e. modeller or pod) of the task run, or whether a TASK_ABORT message still needs to be sent.

WorkerProcessSpawnError

class WorkerProcessSpawnError(    process_name: str, attempts: int, original_exception: Optional[Exception],):

Raised when the worker child process fails to start after all retry attempts.

Attributes

  • process_name: Name of the process that failed to start.
  • attempts: Number of attempts made before failure.
  • original_exception: The underlying exception that caused the failure, or None if the process never attempted to start.

Ancestors