From 4e2bda2555c651cf2185df47345f1dc90789799c Mon Sep 17 00:00:00 2001 From: Morten Lund Date: Tue, 14 Sep 2021 11:03:07 +0200 Subject: [PATCH] Better error message when seach_subdirs fails fixes #69 --- anypytools/abcutils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/anypytools/abcutils.py b/anypytools/abcutils.py index 5544e7b..a795a66 100644 --- a/anypytools/abcutils.py +++ b/anypytools/abcutils.py @@ -748,6 +748,10 @@ def start_macro( # Extend the folderlist if search_subdir is given if isinstance(search_subdirs, str) and isinstance(folderlist[0], str): folderlist = sum([getsubdirs(d, search_subdirs) for d in folderlist], []) + if len(folderlist) == 0: + raise ValueError( + f"No subdirectories found, which match the file:{search_subdirs}" + ) # Check for explicit logfile if not isinstance(logfile, (type(None), str, os.PathLike)): raise ValueError("logfile must be a str or path")