Skip to content

Commit

Permalink
Merge pull request #248 from napalm-automation/disconnect-error
Browse files Browse the repository at this point in the history
More exceptions
  • Loading branch information
mirceaulinic authored May 31, 2017
2 parents fe4ea04 + b3b5c9b commit 08f30e3
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions napalm_base/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,40 @@ class ModuleImportError(Exception):


class ConnectionException(Exception):
'''
Unable to connect to the network device.
'''
pass


class ConnectAuthError(ConnectionException):
'''
Unable to connect to the network device
due to invalid credentials.
'''
pass


class ConnectTimeoutError(ConnectionException):
'''
Exception raised when the connection to the
network device takes too long.
This may be avoided by adjusting the `timeout`
argument.
'''
pass


class ConnectionClosedException(ConnectionException):
'''
The network device closed the connection.
Raised whenever we try to execute a certain
function, but we detect that the connection
is not usable anymore. This can happen for
various reasons: the network device terminates the
session or it is dropped by a firewall or
the server.
'''
pass


Expand All @@ -33,6 +67,28 @@ class MergeConfigException(Exception):
pass


class CommitError(Exception):
'''
Raised when unable to commit the candidate config
into the running config.
'''
pass


class LockError(Exception):
'''
Unable to lock the candidate config.
'''
pass


class UnlockError(Exception):
'''
Unable to unlock the candidate config.
'''
pass


class SessionLockedException(Exception):
pass

Expand Down

0 comments on commit 08f30e3

Please sign in to comment.