Skip to content

Commit

Permalink
enh: log exception info (at debug) when we catch an exception in map_…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
yarikoptic committed Dec 13, 2024
1 parent 3ea8c87 commit d05c7f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dandi/cli/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d05c7f1

Please sign in to comment.