Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Add logging and exception handling to Data Hub request functions #987

Merged

Conversation

oliverjwroberts
Copy link
Contributor

@oliverjwroberts oliverjwroberts commented Jul 25, 2024

Description of change

To help debug ongoing (and possible future) issues between EMT and DataHub (see #986), this PR adds logging and exception handling, as well as more graceful error handling, to a couple of Data Hub request functions.

Test instructions

Upon submitting an enquiry to DataHub, if an error occurs, the server will most like return code 500 with little to no output in the logs.

Now, the application will gracefully display an error message, as well as log further information, including the response body. For this example, that would be: {'detail': 'Incorrect authentication credentials.'}.

image

@oliverjwroberts oliverjwroberts force-pushed the bugfix/CPS-600-add-logging-to-data-hub-requests branch from e0a23d8 to 2107ace Compare July 29, 2024 10:39
@oliverjwroberts oliverjwroberts requested a review from a team as a code owner July 29, 2024 10:39
@oliverjwroberts oliverjwroberts merged commit 0d95a15 into main Jul 29, 2024
3 checks passed
@oliverjwroberts oliverjwroberts deleted the bugfix/CPS-600-add-logging-to-data-hub-requests branch July 29, 2024 10:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants