Skip to content

Commit

Permalink
catch errors for get-folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Marshall-Hallenbeck committed Jan 17, 2025
1 parent 28d8274 commit 9fef9ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nxc/protocols/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,11 @@ def download_folder(self, folder, dest, recursive=False, silent=False, base_dir=
base_folder = os.path.basename(normalized_folder)
self.logger.debug(f"Base folder: {base_folder}")

items = self.conn.listPath(self.args.share, ntpath.join(folder, "*"))
try:
items = self.conn.listPath(self.args.share, ntpath.join(folder, "*"))
except SessionError as e:
self.logger.error(f"Error listing folder '{folder}': {e}")
return
self.logger.debug(f"{len(items)} items in folder: {items}")

for item in items:
Expand Down

0 comments on commit 9fef9ed

Please sign in to comment.