Skip to content

Commit

Permalink
Change: Improve error output in case of unix socket connection issues (
Browse files Browse the repository at this point in the history
…#835)

Add the causing exception message to the raised error if connecting to
the unix socket fails. This will allow for better debugging of the
cause.
  • Loading branch information
bjoernricks authored Sep 27, 2022
1 parent de08b0d commit 662572d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gvm/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,10 @@ def connect(self) -> None:
self._socket.connect(self.path)
except FileNotFoundError:
raise GvmError(f"Socket {self.path} does not exist") from None
except ConnectionError:
raise GvmError(f"Could not connect to socket {self.path}") from None
except ConnectionError as e:
raise GvmError(
f"Could not connect to socket {self.path}. Error was {e}"
) from None


class DebugConnection:
Expand Down

0 comments on commit 662572d

Please sign in to comment.