Skip to content

shell_utils

drunc.utils.shell_utils

Classes

InterruptedCommand(message='An error occurred in Drunc.', grpc_error_code=None, details=None, **detail_kwargs)

Bases: DruncShellException

This exception gets thrown if we don't want to have a full stack, but still want to interrupt a shell command

Source code in drunc/exceptions.py
def __init__(
    self,
    message: str = "An error occurred in Drunc.",
    grpc_error_code=None,
    details=None,  # optional rich error detail
    **detail_kwargs,
):
    super().__init__(message)

    if message is not None:
        self.message = message

    if grpc_error_code is None:
        grpc_error_code = getattr(self, "grpc_error_code", code_pb2.INTERNAL)

    if details is not None:
        self.details = details

    self.detail_kwargs = detail_kwargs

Functions