From 75f53137bc4d59b974396123283cb632094f0233 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!"))