From d3b7c61feb093cc9b783393e956f7ea5657f8c0c Mon Sep 17 00:00:00 2001 From: Mircea Ulinic Date: Tue, 30 May 2017 12:37:41 +0000 Subject: [PATCH] Defien more exceptions as per #218 --- napalm_base/exceptions.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/napalm_base/exceptions.py b/napalm_base/exceptions.py index d93dd32b..f5fa09af 100644 --- a/napalm_base/exceptions.py +++ b/napalm_base/exceptions.py @@ -29,6 +29,21 @@ class ConnectionException(Exception): pass +class ConnectAuthError(ConnectionException): + ''' + Unable to connect to the network device + due to invalid credentials. + ''' + pass + + +class ConnectTimeoutError(ConnectionException): + ''' + Connection to the network device takes too long. + ''' + pass + + class ConnectionClosedException(ConnectionException): ''' The network device closed the connection. @@ -47,6 +62,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