Skip to content

exceptions

scrapli.exceptions

ScrapliAuthenticationFailed

Bases: ScrapliException

Exception for scrapli authentication issues

Source code in scrapli/exceptions.py
59
60
class ScrapliAuthenticationFailed(ScrapliException):
    """Exception for scrapli authentication issues"""

ScrapliCommandFailure

Bases: ScrapliException

Exception for scrapli command/config failures

Source code in scrapli/exceptions.py
71
72
class ScrapliCommandFailure(ScrapliException):
    """Exception for scrapli command/config failures"""

ScrapliConnectionError

Bases: ScrapliException

Exception for underlying connection issues

Source code in scrapli/exceptions.py
63
64
class ScrapliConnectionError(ScrapliException):
    """Exception for underlying connection issues"""

ScrapliConnectionNotOpened

Bases: ScrapliException

Exception for trying to operate on a transport which has not been opened

Source code in scrapli/exceptions.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class ScrapliConnectionNotOpened(ScrapliException):
    """Exception for trying to operate on a transport which has not been opened"""

    def __init__(
        self,
        message: Optional[str] = None,
    ) -> None:
        """
        Scrapli connection not opened exception

        Args:
            message: optional message

        Returns:
            None

        Raises:
            N/A

        """
        if not message:
            self.message = (
                "connection not opened, but attempting to call a method that requires an open "
                "connection, do you need to call 'open()'?"
            )
        else:
            self.message = message
        super().__init__(self.message)

__init__(message: Optional[str] = None) -> None

Scrapli connection not opened exception

Parameters:

Name Type Description Default
message Optional[str]

optional message

None

Returns:

Type Description
None

None

Source code in scrapli/exceptions.py
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def __init__(
    self,
    message: Optional[str] = None,
) -> None:
    """
    Scrapli connection not opened exception

    Args:
        message: optional message

    Returns:
        None

    Raises:
        N/A

    """
    if not message:
        self.message = (
            "connection not opened, but attempting to call a method that requires an open "
            "connection, do you need to call 'open()'?"
        )
    else:
        self.message = message
    super().__init__(self.message)

ScrapliException

Bases: Exception

Base Exception for all scrapli exceptions

Source code in scrapli/exceptions.py
5
6
class ScrapliException(Exception):
    """Base Exception for all scrapli exceptions"""

ScrapliModuleNotFound

Bases: ScrapliException

ModuleNotFound but for scrapli related issues

Source code in scrapli/exceptions.py
 9
10
class ScrapliModuleNotFound(ScrapliException):
    """ModuleNotFound but for scrapli related issues"""

ScrapliPrivilegeError

Bases: ScrapliException

Exception for all privilege related scrapli issues

Source code in scrapli/exceptions.py
75
76
class ScrapliPrivilegeError(ScrapliException):
    """Exception for all privilege related scrapli issues"""

ScrapliTimeout

Bases: ScrapliException

Exception for any scrapli timeouts

Source code in scrapli/exceptions.py
67
68
class ScrapliTimeout(ScrapliException):
    """Exception for any scrapli timeouts"""

ScrapliTransportPluginError

Bases: ScrapliException

Exception for transport plugin issues

Source code in scrapli/exceptions.py
25
26
class ScrapliTransportPluginError(ScrapliException):
    """Exception for transport plugin issues"""

ScrapliTypeError

Bases: ScrapliException

TypeError but for scrapli related typing issues

Source code in scrapli/exceptions.py
13
14
class ScrapliTypeError(ScrapliException):
    """TypeError but for scrapli related typing issues"""

ScrapliUnsupportedPlatform

Bases: ScrapliException

Exception for unsupported platform; i.e. using system transport on windows

Source code in scrapli/exceptions.py
21
22
class ScrapliUnsupportedPlatform(ScrapliException):
    """Exception for unsupported platform; i.e. using system transport on windows"""

ScrapliValueError

Bases: ScrapliException

ValueError but for scrapli related value issues

Source code in scrapli/exceptions.py
17
18
class ScrapliValueError(ScrapliException):
    """ValueError but for scrapli related value issues"""