From d7f61985ffb413304c329060867923cbb0ce7a1e Mon Sep 17 00:00:00 2001 From: "Remi GASCOU (Podalirius)" <79218792+p0dalirius@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:21:41 +0200 Subject: [PATCH] Add error message when port is closed or authentication failed, fixes #66 --- smbclientng/core/SMBSession.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smbclientng/core/SMBSession.py b/smbclientng/core/SMBSession.py index 63037d4..709bd52 100644 --- a/smbclientng/core/SMBSession.py +++ b/smbclientng/core/SMBSession.py @@ -125,11 +125,12 @@ def init_smb_session(self): sess_port=int(self.port) ) else: + self.logger.error("Could not connect to '%s:%d'" % (self.host, int(self.port))) self.connected = False except OSError as err: if self.config.debug: traceback.print_exc() - self.logger.error(err) + self.logger.error("Could not connect to '%s:%d': %s" % (self.host, int(self.port), err)) self.smbClient = None if self.smbClient is not None: