Skip to content

Exceptions

Core exception classes used throughout DiracX.

exceptions

Classes

DiracHttpResponseError

Bases: RuntimeError

Source code in diracx-core/src/diracx/core/exceptions.py
6
7
8
9
class DiracHttpResponseError(RuntimeError):
    def __init__(self, status_code: int, data):
        self.status_code = status_code
        self.data = data
Attributes
status_code = status_code instance-attribute
data = data instance-attribute

DiracError

Bases: RuntimeError

Source code in diracx-core/src/diracx/core/exceptions.py
class DiracError(RuntimeError):
    http_status_code = HTTPStatus.BAD_REQUEST  # 400
    http_headers: dict[str, str] | None = None

    def __init__(self, detail: str = "Unknown"):
        self.detail = detail
Attributes
http_status_code = HTTPStatus.BAD_REQUEST class-attribute instance-attribute
http_headers = None class-attribute instance-attribute
detail = detail instance-attribute

AuthorizationError

Bases: DiracError

Source code in diracx-core/src/diracx/core/exceptions.py
class AuthorizationError(DiracError): ...

PendingAuthorizationError

Bases: AuthorizationError

Used to signal the device flow the authentication is still ongoing.

Source code in diracx-core/src/diracx/core/exceptions.py
class PendingAuthorizationError(AuthorizationError):
    """Used to signal the device flow the authentication is still ongoing."""

IAMServerError

Bases: DiracError

Used whenever we encounter a server problem with the IAM server.

Source code in diracx-core/src/diracx/core/exceptions.py
class IAMServerError(DiracError):
    """Used whenever we encounter a server problem with the IAM server."""

IAMClientError

Bases: DiracError

Used whenever we encounter a client problem with the IAM server.

Source code in diracx-core/src/diracx/core/exceptions.py
class IAMClientError(DiracError):
    """Used whenever we encounter a client problem with the IAM server."""

InvalidCredentialsError

Bases: DiracError

Used whenever the credentials are invalid.

Source code in diracx-core/src/diracx/core/exceptions.py
class InvalidCredentialsError(DiracError):
    """Used whenever the credentials are invalid."""

ConfigurationError

Bases: DiracError

Used whenever we encounter a problem with the configuration.

Source code in diracx-core/src/diracx/core/exceptions.py
class ConfigurationError(DiracError):
    """Used whenever we encounter a problem with the configuration."""

BadConfigurationVersionError

Bases: ConfigurationError

The requested version is not known.

Source code in diracx-core/src/diracx/core/exceptions.py
class BadConfigurationVersionError(ConfigurationError):
    """The requested version is not known."""

InvalidQueryError

Bases: DiracError

It was not possible to build a valid database query from the given input.

Source code in diracx-core/src/diracx/core/exceptions.py
class InvalidQueryError(DiracError):
    """It was not possible to build a valid database query from the given input."""

TokenNotFoundError

Bases: DiracError

Source code in diracx-core/src/diracx/core/exceptions.py
class TokenNotFoundError(DiracError):
    def __init__(self, jti: str, detail: str | None = None):
        self.jti: str = jti
        super().__init__(f"Token {jti} not found" + (f" ({detail})" if detail else ""))
Attributes
jti = jti instance-attribute

JobNotFoundError

Bases: DiracError

Source code in diracx-core/src/diracx/core/exceptions.py
class JobNotFoundError(DiracError):
    def __init__(self, job_id: int, detail: str | None = None):
        self.job_id: int = job_id
        super().__init__(f"Job {job_id} not found" + (f" ({detail})" if detail else ""))
Attributes
job_id = job_id instance-attribute

SandboxNotFoundError

Bases: DiracError

Source code in diracx-core/src/diracx/core/exceptions.py
class SandboxNotFoundError(DiracError):
    def __init__(self, pfn: str, se_name: str, detail: str | None = None):
        self.pfn: str = pfn
        self.se_name: str = se_name
        super().__init__(
            f"Sandbox with {pfn} and {se_name} not found"
            + (f" ({detail})" if detail else "")
        )
Attributes
pfn = pfn instance-attribute
se_name = se_name instance-attribute

SandboxAlreadyAssignedError

Bases: DiracError

Source code in diracx-core/src/diracx/core/exceptions.py
class SandboxAlreadyAssignedError(DiracError):
    def __init__(self, pfn: str, se_name: str, detail: str | None = None):
        self.pfn: str = pfn
        self.se_name: str = se_name
        super().__init__(
            f"Sandbox with {pfn} and {se_name} already assigned"
            + (f" ({detail})" if detail else "")
        )
Attributes
pfn = pfn instance-attribute
se_name = se_name instance-attribute

SandboxAlreadyInsertedError

Bases: DiracError

Source code in diracx-core/src/diracx/core/exceptions.py
class SandboxAlreadyInsertedError(DiracError):
    def __init__(self, pfn: str, se_name: str, detail: str | None = None):
        self.pfn: str = pfn
        self.se_name: str = se_name
        super().__init__(
            f"Sandbox with {pfn} and {se_name} already inserted"
            + (f" ({detail})" if detail else "")
        )
Attributes
pfn = pfn instance-attribute
se_name = se_name instance-attribute

JobError

Bases: DiracError

Source code in diracx-core/src/diracx/core/exceptions.py
class JobError(DiracError):
    def __init__(self, job_id, detail: str | None = None):
        self.job_id: int = job_id
        super().__init__(
            f"Error concerning job {job_id}" + (f" ({detail})" if detail else "")
        )
Attributes
job_id = job_id instance-attribute

NotReadyError

Bases: DiracError

Tried to access a value which is asynchronously loaded but not yet available.

Source code in diracx-core/src/diracx/core/exceptions.py
class NotReadyError(DiracError):
    """Tried to access a value which is asynchronously loaded but not yet available."""