Skip to content

Commit f2f36d6

Browse files
committed
Refine debugging output in packages
Reporting a full stack trace and reraising an exception is helpful in debug mode. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 2829ccc commit f2f36d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/packagedcode/recognize.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def _parse(
118118
# We should continue when an Exception has occured when trying to
119119
# recognize a package
120120
if TRACE:
121-
logger_debug(f'_parse: Exception: {str(e)}')
121+
import traceback
122+
logger_debug(f'_parse: Exception: {str(e)} : {traceback.format_exc()}')
123+
raise Exception(f'_parse: error') from e
122124

123125
continue

0 commit comments

Comments
 (0)