Skip to content

Commit

Permalink
catch
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Nov 24, 2023
1 parent 33a8b70 commit 5f3a3ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Version 1.9.47
---------
* Remote backup: catch socket exceptions accordingly, provide better
error message if connection fails.
* Remote backup: catch more exceptions accordingly, provide better
error message if ssh connection fails.

Version 1.9.46
---------
Expand Down
3 changes: 3 additions & 0 deletions libvirtnbdbackup/ssh/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
SFTPClient,
SSHException,
AuthenticationException,
BadHostKeyException,
)

from libvirtnbdbackup.ssh import exceptions
Expand Down Expand Up @@ -76,6 +77,8 @@ def connect(self) -> SSHClient:
)
except socket.gaierror as e:
raise exceptions.sshError(f"Unable to connect: {e}")
except BadHostKeyException as e:
raise exceptions.sshError(e)
except Exception as e:
log.exception(e)
raise exceptions.sshError(f"Unknown exception occurred: {e}")
Expand Down

0 comments on commit 5f3a3ce

Please sign in to comment.