Skip to content

Commit

Permalink
Make debugging easier by re-raising BdbQuit
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
  • Loading branch information
carmenbianca committed Dec 12, 2023
1 parent f53a4ed commit 33cdd16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/reuse/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

"""Module that contains reports about files and projects for linting."""

import bdb
import contextlib
import datetime
import logging
Expand Down Expand Up @@ -302,6 +303,9 @@ def generate(

for result in results:
if result.error:
# Facilitate better debugging by being able to quit the program.
if isinstance(result.error, bdb.BdbQuit):
raise bdb.BdbQuit() from result.error
if isinstance(result.error, (OSError, UnicodeError)):
_LOGGER.error(
_("Could not read '{path}'").format(path=result.path),
Expand Down

0 comments on commit 33cdd16

Please sign in to comment.