uktrade / enquiry-mgmt-tool

Enquiry management tool supporting the Ready to Trade campaign
https://uktrade.github.io/enquiry-mgmt-tool/
MIT License
1 stars 2 forks source link

Log traceback when exception is raised #999

Closed oliverjwroberts closed 1 month ago

oliverjwroberts commented 1 month ago

Description of change

987 added exception logging to some functions, however, it was deemed more useful to also log the traceback when an exception occurs.

This PR adds such functionality. It also fixes a bug introduced in the aforementioned PR, that references the variable response in an except block, where it is out of scope.

Test instructions

You should now see the traceback logged when an exception occurs during the sending of requests to Data Hub.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 68.68%. Comparing base (0d95a15) to head (9c5e372).

Files Patch % Lines
app/enquiries/common/datahub_utils.py 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #999 +/- ## ======================================= Coverage 68.68% 68.68% ======================================= Files 61 61 Lines 2034 2034 ======================================= Hits 1397 1397 Misses 637 637 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.