Source code for beaker.exceptions

from grpc import RpcError
from requests.exceptions import HTTPError, RequestException

__all__ = [
    "BeakerError",
    "RpcError",
    "HTTPError",
    "BeakerClientError",
    "BeakerServerError",
    "BeakerStreamConnectionClosedError",
    "BeakerServerUnavailableError",
    "RequestException",
    "BeakerConfigurationError",
    "BeakerNotFoundError",
    "BeakerOrganizationNotFound",
    "BeakerUserNotFound",
    "BeakerWorkspaceNotFound",
    "BeakerClusterNotFound",
    "BeakerNodeNotFound",
    "BeakerBudgetNotFound",
    "BeakerGroupNotFound",
    "BeakerQueueNotFound",
    "BeakerQueueEntryNotFound",
    "BeakerQueueWorkerNotFound",
    "BeakerImageNotFound",
    "BeakerDatasetNotFound",
    "BeakerSecretNotFound",
    "BeakerExperimentNotFound",
    "BeakerWorkloadNotFound",
    "BeakerJobNotFound",
    "BeakerOrganizationNotSet",
    "BeakerWorkspaceNotSet",
    "BeakerPermissionsError",
    "BeakerNameConflictError",
    "BeakerDatasetConflict",
    "BeakerExperimentConflict",
    "BeakerImageConflict",
    "BeakerSecretConflict",
    "BeakerGroupConflict",
    "BeakerWorkspaceConflict",
    "BeakerDatasetWriteError",
    "BeakerUnexpectedEOFError",
    "BeakerChecksumFailedError",
    "BeakerDockerError",
    "BeakerWorkerThreadError",
    "BeakerCreateQueueEntryFailedError",
]


[docs] class BeakerError(Exception): """Base class for all Beaker errors."""
[docs] class BeakerClientError(BeakerError): pass
[docs] class BeakerServerError(BeakerError): pass
[docs] class BeakerStreamConnectionClosedError(BeakerServerError): """ Raised when the server closes a long-running streaming connection prematurely. See https://github.com/allenai/beaker/issues/6532. """
[docs] class BeakerServerUnavailableError(BeakerServerError): pass
[docs] class BeakerConfigurationError(BeakerError): """Raised when invalid fields are found in the config file."""
[docs] class BeakerNotFoundError(BeakerError): """Base class for not found errors."""
[docs] class BeakerOrganizationNotFound(BeakerNotFoundError): """Raised when a specified organization doesn't exist."""
[docs] class BeakerUserNotFound(BeakerNotFoundError): """Raised when a specified user doesn't exist."""
[docs] class BeakerWorkspaceNotFound(BeakerNotFoundError): """Raised when a specified workspace doesn't exist."""
[docs] class BeakerClusterNotFound(BeakerNotFoundError): """Raised when a specified cluster doesn't exist."""
[docs] class BeakerNodeNotFound(BeakerNotFoundError): """Raised when a specified node doesn't exist."""
[docs] class BeakerBudgetNotFound(BeakerNotFoundError): """Raised when a specified budget doesn't exist."""
[docs] class BeakerGroupNotFound(BeakerNotFoundError): """Raised when a specified group doesn't exist."""
[docs] class BeakerQueueNotFound(BeakerNotFoundError): """Raised when a specified queue doesn't exist."""
[docs] class BeakerQueueEntryNotFound(BeakerNotFoundError): """Raised when a specified queue entry doesn't exist."""
[docs] class BeakerQueueWorkerNotFound(BeakerNotFoundError): """Raised when a specified queue worker doesn't exist."""
[docs] class BeakerJobNotFound(BeakerNotFoundError): """Raised when a specified job doesn't exist."""
[docs] class BeakerExperimentNotFound(BeakerNotFoundError): """Raised when a specified experiment doesn't exist."""
[docs] class BeakerWorkloadNotFound(BeakerNotFoundError): """Raised when a specified workload doesn't exist."""
[docs] class BeakerImageNotFound(BeakerNotFoundError): """Raised when a specified image doesn't exist."""
[docs] class BeakerDatasetNotFound(BeakerNotFoundError): """Raised when a specified dataset doesn't exist."""
[docs] class BeakerSecretNotFound(BeakerNotFoundError): """Raised when a specified secret does not exist."""
[docs] class BeakerOrganizationNotSet(BeakerError): """Raised when the default organization is not set."""
[docs] class BeakerWorkspaceNotSet(BeakerError): """Raised when the default workspace is not set."""
[docs] class BeakerPermissionsError(BeakerError): pass
[docs] class BeakerNameConflictError(BeakerError): """Base error type for name conflict errors."""
[docs] class BeakerDatasetConflict(BeakerNameConflictError): pass
[docs] class BeakerExperimentConflict(BeakerNameConflictError): pass
[docs] class BeakerImageConflict(BeakerNameConflictError): pass
[docs] class BeakerSecretConflict(BeakerNameConflictError): pass
[docs] class BeakerGroupConflict(BeakerNameConflictError): pass
[docs] class BeakerWorkspaceConflict(BeakerNameConflictError): pass
[docs] class BeakerDatasetWriteError(BeakerError): pass
[docs] class BeakerUnexpectedEOFError(BeakerError): pass
[docs] class BeakerChecksumFailedError(BeakerError): pass
[docs] class BeakerDockerError(BeakerError): pass
[docs] class BeakerWorkerThreadError(BeakerError): """ Raised when a worker thread dies. """
[docs] class BeakerCreateQueueEntryFailedError(BeakerError): """ Raised when creating a new queue entry fails. """