Source code for jina.excepts

"""This modules defines all kinds of exceptions raised in Jina."""

[docs]class NoExplicitMessage(Exception): """Waiting until all partial messages are received."""
[docs]class ChainedPodException(Exception): """Chained exception from the last Pod."""
[docs]class MismatchedVersion(SystemError): """When the jina version info of the incoming message does not match the local Jina version."""
[docs]class ExecutorFailToLoad(SystemError): """When the executor can not be loaded in pea/pod."""
[docs]class RuntimeFailToStart(SystemError): """When pea/pod is failed to started."""
[docs]class MemoryOverHighWatermark(Exception): """When the memory usage is over the defined high water mark."""
[docs]class NoAvailablePortError(Exception): """When no available random port could be found"""
[docs]class RuntimeTerminated(KeyboardInterrupt): """The event loop of BasePea ends."""
[docs]class UnknownControlCommand(RuntimeError): """The control command received can not be recognized."""
[docs]class FlowTopologyError(Exception): """Flow exception when the topology is ambiguous."""
[docs]class FlowMissingPodError(Exception): """Flow exception when a pod can not be found in the flow."""
[docs]class FlowBuildLevelError(Exception): """Flow exception when required build level is higher than the current build level."""
[docs]class BadConfigSource(FileNotFoundError): """The yaml config file is bad, not loadable or not exist."""
[docs]class BadClient(Exception): """A wrongly defined client, can not communicate with jina server correctly."""
[docs]class BadClientCallback(BadClient): """Error in the callback function on the client side."""
[docs]class BadClientInput(BadClient): """Error in the request generator function on the client side."""
[docs]class ModelCheckpointNotExist(FileNotFoundError): """Exception to raise for executors depending on pretrained model files when they do not exist."""
[docs]class PretrainedModelFileDoesNotExist(ModelCheckpointNotExist): """Depreciated, used in the hub executors. TODO: to be removed after hub executors uses ModelCheckpointNotExist """
[docs]class HubDownloadError(Exception): """Exception to raise when :command:`jina hub pull` fails to download package."""
[docs]class BadDocType(TypeError): """Exception when can not construct a document from the given data."""
[docs]class BadRequestType(TypeError): """Exception when can not construct a request object from given data."""
[docs]class BadNamedScoreType(TypeError): """Exception when can not construct a named score from the given data."""
[docs]class BadImageNameError(Exception): """Exception when an image name can not be found either local & remote"""
[docs]class BadYAMLVersion(Exception): """Exception when YAML config specifies a wrong version number."""
[docs]class DaemonConnectivityError(Exception): """Exception to raise when jina daemon is not reachable."""
[docs]class DaemonWorkspaceCreationFailed(Exception): """Exception to raise when jina daemon is not connectable."""
[docs]class DaemonPeaCreationFailed(Exception): """Exception to raise when jina daemon is not connectable."""
[docs]class NotSupportedError(Exception): """Exeception when user accidentally using a retired argument."""
[docs]class ValidationError(Exception): """Raised when a certain validation cannot be completed."""
[docs]class SocketTypeError(Exception): """Raised when such socket type is not supported or does not exist."""
[docs]class RoutingTableCyclicError(Exception): """Raised when the routing graph has cycles."""
[docs]class RuntimeRunForeverEarlyError(Exception): """Raised when an error occurs when starting the run_forever of Runtime"""
[docs]class DockerVersionError(SystemError): """Raised when the docker version is incompatible"""
[docs]class DaemonInvalidDockerfile(FileNotFoundError): """Raised when invalid dockerfile is passed to JinaD"""