judgevet.domain.provider_errors

Status: draft.

judgevet.domain.provider_errors

Neutral errors for application-owned judgment providers.

Applications map known backend failures to these classes using safe messages. Unexpected exceptions retain their original types. These errors add no HTTP status or retry guarantees. MissingEvidenceError distinguishes absent required images. ProviderBusyError marks a provider that is up while another model or caller holds the backend, so no judgment ran. Source: https://github.com/Alberto-Codes/judgevet/issues/200#issuecomment-5850335591.

ProviderError is defined in judgevet.domain.errors, because JevError derives from it, and this module re-exports the same class. Source: https://github.com/Alberto-Codes/judgevet/issues/259#issuecomment-5910551186.

Examples:

from judgevet.domain.provider_errors import ProviderUnavailableError

error = ProviderUnavailableError("Install the application provider extra")
assert str(error) == "Install the application provider extra"
See Also

MissingEvidenceError

Bases: ProviderRequestError

A required question has no associated image evidence.

Source: https://github.com/Alberto-Codes/judgevet/issues/203#issuecomment-5851219798.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.media import MissingEvidenceError

error = MissingEvidenceError("Required question has no evidence")
assert isinstance(error, ProviderRequestError)

ProviderBusyError

Bases: ProviderUnavailableError

The provider is up, but another model or caller holds the backend.

No judgment ran. A shared router that refuses to load the requested model while another model holds it maps to this class. Source: https://github.com/Alberto-Codes/typevet/issues/461.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.providers import ProviderBusyError, ProviderUnavailableError

error = ProviderBusyError("Another model holds the backend")
assert isinstance(error, ProviderUnavailableError)

ProviderCapabilityError

Bases: ProviderError

The selected provider does not support a required capability.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.providers import ProviderCapabilityError

error = ProviderCapabilityError("Synthetic provider failure")
assert str(error) == "Synthetic provider failure"

ProviderError

Bases: JudgevetError

Base for declared application provider failures.

The hosted Jev hierarchy derives from this class, so the conformance kit accepts a hosted failure as a provider failure. The public import path is judgevet.providers; judgevet.domain.provider_errors re-exports it. Source: https://github.com/Alberto-Codes/judgevet/issues/259#issuecomment-5910551186.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.providers import ProviderError

error = ProviderError("Synthetic provider failure")
assert str(error) == "Synthetic provider failure"

ProviderRequestError

Bases: ProviderError

The provider rejects the supplied request.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.providers import ProviderRequestError

error = ProviderRequestError("Synthetic provider failure")
assert str(error) == "Synthetic provider failure"

ProviderResponseError

Bases: ProviderError

The provider returned data that violates the typed answer contract.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.providers import ProviderResponseError

error = ProviderResponseError("Synthetic provider failure")
assert str(error) == "Synthetic provider failure"

ProviderTransportError

Bases: ProviderError

Communication with the selected provider failed.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.providers import ProviderTransportError

error = ProviderTransportError("Synthetic provider failure")
assert str(error) == "Synthetic provider failure"

ProviderUnavailableError

Bases: ProviderError

The selected provider cannot be acquired or used.

Attributes:

Name Type Description
args tuple

Standard exception arguments containing a safe message.

Examples:

from judgevet.providers import ProviderUnavailableError

error = ProviderUnavailableError("Synthetic provider failure")
assert str(error) == "Synthetic provider failure"