Exceptions

This chapter describes all the exceptions used by condoor module.

Init file for condoor.

exception GeneralError(message=None, host=None)[source]

Bases: exceptions.Exception

General error.

This is a base class for all exceptions raised by condoor module.

__init__(message=None, host=None)[source]

Initialize the GeneralError object.

Args:
message (str): Custom message to be passed to the exceptions. Defaults to None.
If None then the general class __doc__ is used.
host (str): Custom string which can be used to enhance the exception message by adding the “host: “
prefix to the message string. Defaults to None. If host is None then message stays unchanged.

Connection exceptions

The exceptions below are related to connection handling events. There are covered three cases:

  • general connection errors caused by device disconnect or jumphosts disconnects,
  • authentication errors caused by using wrong credentials to access the device,
  • timeout errors caused by lack of response within defined amount of time.
exception ConnectionError(message=None, host=None)[source]

General connection error.

Bases: condoor.GeneralError

exception ConnectionAuthenticationError(message=None, host=None)[source]

Connection authentication error.

Bases: condoor.ConnectionError

exception ConnectionTimeoutError(message=None, host=None)[source]

Connection timeout error.

Bases: condoor.ConnectionError

Command exceptions

The exceptions below are related to command execution. There are covered three cases:

  • generic command execution error,
  • command syntax error,
  • command execution timeout.
exception CommandError(message=None, host=None, command=None)[source]

Command execution error.

This is base class for command related exceptions which extends the standard message with a ‘command’ string for better user experience and error reporting.

Bases: condoor.GeneralError

__init__(message=None, host=None, command=None)[source]

Initialize CommandError object.

Args:
message (str): Custom message to be passed to the exceptions. Defaults to None.
If None then the general class __doc__ is used.
host (str): Custom string which can be used to enhance the exception message by adding the “host: “
prefix to the message string. Defaults to None. If host is None then message stays unchanged.
command (str): Custom string which can be used enhance the exception message by adding the
command” suffix to the message string. Defaults to None. If command is None then the message stays unchanged.
exception CommandSyntaxError(message=None, host=None, command=None)[source]

Command syntax error.

Bases: condoor.CommandError

exception CommandTimeoutError(message=None, host=None, command=None)[source]

Command timeout error.

Bases: condoor.CommandError

URL exceptions

This exception is raised when invalid URL to the condoor.Connection class is passed.

exception InvalidHopInfoError(message=None, host=None)[source]

Invalid device connection parameters.

Bases: condoor.GeneralError

Pexpect exceptions

Those are exceptions derived from pexpect module. This exception is used in FSM and condoor.Connection.run_fsm()

exception TIMEOUT(value)[source]

Bases: pexpect.exceptions.ExceptionPexpect

Raised when a read time exceeds the timeout.