Skip to content

Commit

Permalink
fix: Unwrap convert_spreadsheet so we can avoid running logger.except…
Browse files Browse the repository at this point in the history
…ion for a handled error
  • Loading branch information
jpmckinney committed Jul 16, 2024
1 parent 520259f commit 079d2a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cove_ocds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def explore_ocds(request, pk):

try:
context.update(
convert_spreadsheet(
convert_spreadsheet.__wrapped__(
upload_dir,
upload_url,
file_name,
Expand Down Expand Up @@ -242,9 +242,11 @@ def explore_ocds(request, pk):
"error": format(err),
}
)

else:
raise
except Exception as err:
logger.exception(err, extra={"request": request})
raise CoveInputDataError(wrapped_err=err)

with open(context["converted_path"], encoding="utf-8") as fp:
json_data = json.load(fp)
Expand Down

0 comments on commit 079d2a9

Please sign in to comment.