Skip to content

Errors

Custom errors for env_exec

CreateEnvError

Bases: EnvExecError

Exception raised for errors in the execution of a command.

Source code in src/env_exec/errors.py
class CreateEnvError(EnvExecError):
    """Exception raised for errors in the execution of a command.

    Attributes:
        message -- explanation of the error
    """

    def __init__(self, message):
        """
        Initializes a CreateEnvError object.

        Args:
            message (str): Explanation of the error.

        Returns:
            CreateEnvError: A CreateEnvError object.

        Examples:
            >>> raise CreateEnvError('Error creating environment.')
            CreateEnvError: Error creating environment.
        """
        self.message = message
        super().__init__(self.message)

__init__(message)

Initializes a CreateEnvError object.

Parameters:

Name Type Description Default
message str

Explanation of the error.

required

Returns:

Name Type Description
CreateEnvError

A CreateEnvError object.

Examples:

>>> raise CreateEnvError('Error creating environment.')
CreateEnvError: Error creating environment.
Source code in src/env_exec/errors.py
def __init__(self, message):
    """
    Initializes a CreateEnvError object.

    Args:
        message (str): Explanation of the error.

    Returns:
        CreateEnvError: A CreateEnvError object.

    Examples:
        >>> raise CreateEnvError('Error creating environment.')
        CreateEnvError: Error creating environment.
    """
    self.message = message
    super().__init__(self.message)

EnvExecError

Bases: Exception

Base class for exceptions in this module.

Source code in src/env_exec/errors.py
6
7
8
class EnvExecError(Exception):
    """Base class for exceptions in this module."""
    pass

ExecError

Bases: EnvExecError

Exception raised for errors in the execution of a command.

Source code in src/env_exec/errors.py
class ExecError(EnvExecError):
    """Exception raised for errors in the execution of a command.

    Attributes:
        message -- explanation of the error
    """

    def __init__(self, message):
        """
        Initializes an ExecError object.

        Args:
            message (str): Explanation of the error.

        Returns:
            ExecError: An ExecError object.

        Examples:
            >>> raise ExecError('Error in command execution.')
            ExecError: Error in command execution.
        """
        self.message = message
        super().__init__(self.message)

__init__(message)

Initializes an ExecError object.

Parameters:

Name Type Description Default
message str

Explanation of the error.

required

Returns:

Name Type Description
ExecError

An ExecError object.

Examples:

>>> raise ExecError('Error in command execution.')
ExecError: Error in command execution.
Source code in src/env_exec/errors.py
def __init__(self, message):
    """
    Initializes an ExecError object.

    Args:
        message (str): Explanation of the error.

    Returns:
        ExecError: An ExecError object.

    Examples:
        >>> raise ExecError('Error in command execution.')
        ExecError: Error in command execution.
    """
    self.message = message
    super().__init__(self.message)

InstallPackageError

Bases: EnvExecError

Exception raised for errors in the execution of a command.

Source code in src/env_exec/errors.py
class InstallPackageError(EnvExecError):
    """Exception raised for errors in the execution of a command.

    Attributes:
        message -- explanation of the error
    """

    def __init__(self, message):
        """
        Initializes an InstallPackageError object.

        Args:
            message (str): Explanation of the error.

        Returns:
            InstallPackageError: An InstallPackageError object.

        Examples:
            >>> raise InstallPackageError('Error installing package.')
            InstallPackageError: Error installing package.
        """
        self.message = message
        super().__init__(self.message)

__init__(message)

Initializes an InstallPackageError object.

Parameters:

Name Type Description Default
message str

Explanation of the error.

required

Returns:

Name Type Description
InstallPackageError

An InstallPackageError object.

Examples:

>>> raise InstallPackageError('Error installing package.')
InstallPackageError: Error installing package.
Source code in src/env_exec/errors.py
def __init__(self, message):
    """
    Initializes an InstallPackageError object.

    Args:
        message (str): Explanation of the error.

    Returns:
        InstallPackageError: An InstallPackageError object.

    Examples:
        >>> raise InstallPackageError('Error installing package.')
        InstallPackageError: Error installing package.
    """
    self.message = message
    super().__init__(self.message)

ManagerNotAvailable

Bases: EnvExecError

Exception raised for errors in the execution of a command.

Source code in src/env_exec/errors.py
class ManagerNotAvailable(EnvExecError):
    """Exception raised for errors in the execution of a command.

    Attributes:
        message -- explanation of the error
    """

    def __init__(self, message):
        """
        Initializes a ManagerNotAvailable object.

        Args:
            message (str): Explanation of the error.

        Returns:
            ManagerNotAvailable: A ManagerNotAvailable object.

        Examples:
            >>> raise ManagerNotAvailable('Manager not available.')
            ManagerNotAvailable: Manager not available.
        """
        self.message = message
        super().__init__(self.message)

__init__(message)

Initializes a ManagerNotAvailable object.

Parameters:

Name Type Description Default
message str

Explanation of the error.

required

Returns:

Name Type Description
ManagerNotAvailable

A ManagerNotAvailable object.

Examples:

>>> raise ManagerNotAvailable('Manager not available.')
ManagerNotAvailable: Manager not available.
Source code in src/env_exec/errors.py
def __init__(self, message):
    """
    Initializes a ManagerNotAvailable object.

    Args:
        message (str): Explanation of the error.

    Returns:
        ManagerNotAvailable: A ManagerNotAvailable object.

    Examples:
        >>> raise ManagerNotAvailable('Manager not available.')
        ManagerNotAvailable: Manager not available.
    """
    self.message = message
    super().__init__(self.message)

MissingDependencyError

Bases: EnvExecError

Exception raised for errors in the execution of a command.

Source code in src/env_exec/errors.py
class MissingDependencyError(EnvExecError):
    """Exception raised for errors in the execution of a command.

    Attributes:
        message -- explanation of the error
    """

    def __init__(self, message):
        """
        Initializes a MissingDependencyError object.

        Args:
            message (str): Explanation of the error.

        Returns:
            MissingDependencyError: A MissingDependencyError object.

        Examples:
            >>> raise MissingDependencyError('Missing dependency.')
            MissingDependencyError: Missing dependency.
        """
        self.message = message
        super().__init__(self.message)

__init__(message)

Initializes a MissingDependencyError object.

Parameters:

Name Type Description Default
message str

Explanation of the error.

required

Returns:

Name Type Description
MissingDependencyError

A MissingDependencyError object.

Examples:

>>> raise MissingDependencyError('Missing dependency.')
MissingDependencyError: Missing dependency.
Source code in src/env_exec/errors.py
def __init__(self, message):
    """
    Initializes a MissingDependencyError object.

    Args:
        message (str): Explanation of the error.

    Returns:
        MissingDependencyError: A MissingDependencyError object.

    Examples:
        >>> raise MissingDependencyError('Missing dependency.')
        MissingDependencyError: Missing dependency.
    """
    self.message = message
    super().__init__(self.message)