summaryrefslogtreecommitdiff
path: root/obnamlib
diff options
context:
space:
mode:
Diffstat (limited to 'obnamlib')
-rw-r--r--obnamlib/app.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/obnamlib/app.py b/obnamlib/app.py
index ce32f242..e5d76010 100644
--- a/obnamlib/app.py
+++ b/obnamlib/app.py
@@ -22,6 +22,7 @@ import tracing
import cliapp
import larch
+import paramiko
import ttystatus
import obnamlib
@@ -32,6 +33,11 @@ class ObnamIOError(obnamlib.ObnamError):
msg = 'I/O error: {filename}: {errno}: {strerror}'
+class ObnamSSHError(obnamlib.ObnamError):
+
+ msg = 'SSH error: {msg}'
+
+
class ObnamSystemError(obnamlib.ObnamError):
msg = 'System error: {filename}: {errno}: {strerror}'
@@ -221,6 +227,10 @@ class App(cliapp.Application):
self.hooks.call('config-loaded')
cliapp.Application.process_args(self, args)
self.hooks.call('shutdown')
+ except paramiko.SSHException as e:
+ logging.critical(
+ 'Caught SSHExcpetion: %s', str(e), exc_info=True)
+ raise ObnamSSHError(msg=str(e))
except IOError as e:
logging.critical('Caught IOError: %s', str(e), exc_info=True)
raise ObnamIOError(