Skip to content

Commit d5e523a

Browse files
committed
Suppress unwanted TB, see cyclopts#435
1 parent b56e909 commit d5e523a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

hough/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def analyse(
8383

8484

8585
@app.command()
86-
# no @logit
86+
# no @logit - never log this one
8787
def histogram(
8888
results: ExistingFile,
8989
) -> int:

hough/utils.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ def wrapper_logit(*args, **kwargs):
5959
else:
6060
common = CommonArgs()
6161
args = args + (common,)
62-
_setup_loguru(common.loglevel, common.outpath)
62+
try:
63+
_setup_loguru(common.loglevel, common.outpath)
64+
except ValueError:
65+
print(
66+
"Unable to create output directory or logfile! Aborting.",
67+
file=sys.stderr,
68+
)
69+
exit(1)
70+
6371
logger.info(
6472
f"=== Run started @ {datetime.datetime.now(datetime.UTC).isoformat()} ==="
6573
)

0 commit comments

Comments
 (0)