From 10a8c3da1c554a9fc01a512ff19e796c4b035222 Mon Sep 17 00:00:00 2001 From: Andrea Date: Mon, 22 May 2017 09:54:31 +0200 Subject: [PATCH] Handle SSHException --- auto_backup/models/db_backup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/auto_backup/models/db_backup.py b/auto_backup/models/db_backup.py index 338754499..7b1ef6e80 100644 --- a/auto_backup/models/db_backup.py +++ b/auto_backup/models/db_backup.py @@ -126,7 +126,9 @@ class DbBackup(models.Model): # Just open and close the connection with self.sftp_connection(): raise exceptions.Warning(_("Connection Test Succeeded!")) - except (pysftp.CredentialException, pysftp.ConnectionException): + except (pysftp.CredentialException, + pysftp.ConnectionException, + pysftp.SSHException): _logger.info("Connection Test Failed!", exc_info=True) raise exceptions.Warning(_("Connection Test Failed!"))