From d05c7f1a16d947539867f55b8ff5c13e389c9ae4 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 12 Dec 2024 20:28:27 -0500 Subject: [PATCH] enh: log exception info (at debug) when we catch an exception in map_to_click handler User reported a crash where logs where pretty much useless as on the source/reason for exception: ... 2024-12-11T18:28:38-0500 [DEBUG ] dandi 1351865:139891496982272 sub-I48/ses-SPIM/micr/sub-I48_ses-SPIM_sample-BrocaAreaS01_stain-Calretinin_SPIM.ome.zarr/0/1/51/24 - verified that has correct md5 c805c4f34e250a813f2325741faceddc 2024-12-11T18:28:38-0500 [DEBUG ] dandi 1351865:139894578401792 Caught exception May be with traceback logged we get more of useful information --- dandi/cli/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dandi/cli/base.py b/dandi/cli/base.py index 79d96cb16..30fe73247 100644 --- a/dandi/cli/base.py +++ b/dandi/cli/base.py @@ -131,7 +131,7 @@ def wrapper(obj, *args, **kwargs): # raise click.UsageError(str(e)) except Exception as e: e_str = str(e) - lgr.debug("Caught exception %s", e_str) + lgr.debug("Caught exception %s", e_str, exc_info=True) if not map_to_click_exceptions._do_map: raise raise click.ClickException(e_str)