imednet.errors package

Exception hierarchy.

exception imednet.errors.ApiError[source]

Bases: ImednetError

Raised for generic API errors (non-2xx HTTP status codes).

status_code

HTTP status code returned by the API.

response

Parsed JSON or raw text of the error response.

__init__(response, status_code=None)[source]
Parameters:
  • response (Dict[str, Any] | str | Any) –

  • status_code (int | None) –

Return type:

None

exception imednet.errors.AuthenticationError[source]

Bases: ApiError

Raised when authentication to the API fails (HTTP 401).

exception imednet.errors.AuthorizationError[source]

Bases: ApiError

Raised when access to the API is forbidden (HTTP 403).

exception imednet.errors.BadRequestError[source]

Bases: ValidationError

Raised for HTTP 400 bad requests.

exception imednet.errors.ClientError[source]

Bases: ImednetError

Raised for client-side errors (validation, configuration, misuse).

exception imednet.errors.ConfigurationError[source]

Bases: ClientError

Raised when required SDK/client configuration is missing.

exception imednet.errors.ConflictError[source]

Bases: ApiError

Raised for HTTP 409 conflict errors.

exception imednet.errors.ExportBatchError[source]

Bases: ExportError

Raised when a single batch write fails after all retries are exhausted.

__init__(message, *, batch_id)[source]
Parameters:
  • message (str) –

  • batch_id (str) –

Return type:

None

exception imednet.errors.ExportConfigurationError[source]

Bases: ExportError

Raised when a sink is misconfigured (missing credentials, invalid parameters).

exception imednet.errors.ExportError[source]

Bases: ImednetError

Raised when an export sink cannot write a batch or finalize a destination.

exception imednet.errors.FilterConflictError[source]

Bases: OrchestratorError

Raised when both whitelist and blacklist are non-empty simultaneously.

The whitelist and blacklist filters are mutually exclusive operations. Providing both simultaneously creates ambiguous behavior and is rejected at validation time before any study resolution occurs.

Example:

# This raises FilterConflictError — a study key cannot be in both:
orchestrator.execute_pipeline(
    my_func,
    whitelist={"STUDY-A", "STUDY-B"},
    blacklist={"STUDY-C"},
)
__init__(whitelist, blacklist)[source]
Parameters:
  • whitelist (set[str]) –

  • blacklist (set[str]) –

Return type:

None

exception imednet.errors.ForbiddenError[source]

Bases: AuthorizationError

Raised for HTTP 403 forbidden errors.

exception imednet.errors.ImednetError[source]

Bases: Exception

Base exception for all iMednet SDK errors.

exception imednet.errors.NotFoundError[source]

Bases: ApiError

Raised when a requested resource is not found (HTTP 404).

exception imednet.errors.OrchestratorError[source]

Bases: ImednetError

Base exception for all orchestration-layer failures.

Raised when the MultiStudyOrchestrator encounters a structural or configuration error that prevents pipeline execution from starting.

Individual per-study runtime failures are NOT raised as exceptions — they are captured in the OrchestratorResult result matrix with status="FAILED".

exception imednet.errors.PaginationError[source]

Bases: ClientError

Raised when pagination metadata is malformed or inconsistent.

exception imednet.errors.PathTraversalValidationError[source]

Bases: ClientError

Raised when a partition key contains unsafe path content.

exception imednet.errors.PluginLoadError[source]

Bases: ImednetError

Raised when a plugin fails to load or does not satisfy the PluginProtocol.

exception imednet.errors.RateLimitError[source]

Bases: ApiError

Raised when the API rate limit is exceeded (HTTP 429).

exception imednet.errors.RequestError[source]

Bases: ImednetError

Raised when a network request fails after retries.

exception imednet.errors.ServerError[source]

Bases: ApiError

Raised when the API returns a server error (HTTP 5xx).

exception imednet.errors.UnauthorizedError[source]

Bases: AuthenticationError

Raised for HTTP 401 unauthorized errors.

exception imednet.errors.UnknownVariableTypeError[source]

Bases: ValidationError

Raised when an unrecognized variable type is encountered.

exception imednet.errors.ValidationError[source]

Bases: ApiError

Raised when a request is malformed or validation fails (HTTP 400).

imednet.errors.get_error_class(status_code)[source]

Get error class for status code.

Defaults to generic ApiError for unmapped client/server errors.

Return type:

Type[ApiError]

Parameters:

status_code (int) –

Submodules

imednet.errors.api module

API-level errors.

exception imednet.errors.api.ApiError[source]

Bases: ImednetError

Raised for generic API errors (non-2xx HTTP status codes).

status_code

HTTP status code returned by the API.

response

Parsed JSON or raw text of the error response.

__init__(response, status_code=None)[source]
Parameters:
  • response (Dict[str, Any] | str | Any) –

  • status_code (int | None) –

Return type:

None

exception imednet.errors.api.AuthenticationError[source]

Bases: ApiError

Raised when authentication to the API fails (HTTP 401).

exception imednet.errors.api.AuthorizationError[source]

Bases: ApiError

Raised when access to the API is forbidden (HTTP 403).

exception imednet.errors.api.ConflictError[source]

Bases: ApiError

Raised for HTTP 409 conflict errors.

exception imednet.errors.api.ForbiddenError[source]

Bases: AuthorizationError

Raised for HTTP 403 forbidden errors.

exception imednet.errors.api.NotFoundError[source]

Bases: ApiError

Raised when a requested resource is not found (HTTP 404).

exception imednet.errors.api.RateLimitError[source]

Bases: ApiError

Raised when the API rate limit is exceeded (HTTP 429).

exception imednet.errors.api.ServerError[source]

Bases: ApiError

Raised when the API returns a server error (HTTP 5xx).

exception imednet.errors.api.UnauthorizedError[source]

Bases: AuthenticationError

Raised for HTTP 401 unauthorized errors.

imednet.errors.base module

Base errors.

exception imednet.errors.base.ImednetError[source]

Bases: Exception

Base exception for all iMednet SDK errors.

imednet.errors.client module

Client-side errors.

exception imednet.errors.client.ClientError[source]

Bases: ImednetError

Raised for client-side errors (validation, configuration, misuse).

exception imednet.errors.client.PaginationError[source]

Bases: ClientError

Raised when pagination metadata is malformed or inconsistent.

imednet.errors.export module

Export-sink error types.

exception imednet.errors.export.ExportBatchError[source]

Bases: ExportError

Raised when a single batch write fails after all retries are exhausted.

__init__(message, *, batch_id)[source]
Parameters:
  • message (str) –

  • batch_id (str) –

Return type:

None

exception imednet.errors.export.ExportConfigurationError[source]

Bases: ExportError

Raised when a sink is misconfigured (missing credentials, invalid parameters).

exception imednet.errors.export.ExportError[source]

Bases: ImednetError

Raised when an export sink cannot write a batch or finalize a destination.

imednet.errors.network module

Network errors.

exception imednet.errors.network.RequestError[source]

Bases: ImednetError

Raised when a network request fails after retries.

imednet.errors.orchestration module

Exceptions raised by the MultiStudyOrchestrator engine.

exception imednet.errors.orchestration.FilterConflictError[source]

Bases: OrchestratorError

Raised when both whitelist and blacklist are non-empty simultaneously.

The whitelist and blacklist filters are mutually exclusive operations. Providing both simultaneously creates ambiguous behavior and is rejected at validation time before any study resolution occurs.

Example:

# This raises FilterConflictError — a study key cannot be in both:
orchestrator.execute_pipeline(
    my_func,
    whitelist={"STUDY-A", "STUDY-B"},
    blacklist={"STUDY-C"},
)
__init__(whitelist, blacklist)[source]
Parameters:
  • whitelist (set[str]) –

  • blacklist (set[str]) –

Return type:

None

exception imednet.errors.orchestration.OrchestratorError[source]

Bases: ImednetError

Base exception for all orchestration-layer failures.

Raised when the MultiStudyOrchestrator encounters a structural or configuration error that prevents pipeline execution from starting.

Individual per-study runtime failures are NOT raised as exceptions — they are captured in the OrchestratorResult result matrix with status="FAILED".

imednet.errors.plugin module

Plugin-related errors.

exception imednet.errors.plugin.PluginLoadError[source]

Bases: ImednetError

Raised when a plugin fails to load or does not satisfy the PluginProtocol.

imednet.errors.registry module

Registry for HTTP status code to error class mappings.

imednet.errors.registry.get_error_class(status_code)[source]

Get error class for status code.

Defaults to generic ApiError for unmapped client/server errors.

Return type:

Type[ApiError]

Parameters:

status_code (int) –

imednet.errors.validation module

Validation errors.

exception imednet.errors.validation.BadRequestError[source]

Bases: ValidationError

Raised for HTTP 400 bad requests.

exception imednet.errors.validation.ConfigurationError[source]

Bases: ClientError

Raised when required SDK/client configuration is missing.

exception imednet.errors.validation.PathTraversalValidationError[source]

Bases: ClientError

Raised when a partition key contains unsafe path content.

exception imednet.errors.validation.UnknownVariableTypeError[source]

Bases: ValidationError

Raised when an unrecognized variable type is encountered.

exception imednet.errors.validation.ValidationError[source]

Bases: ApiError

Raised when a request is malformed or validation fails (HTTP 400).