Open
Conversation
4cb6c02 to
93fc4d4
Compare
This commit deals with two types of error. First it adds a sentry log when there is a file not found on s3. Second it catches any exceptions raised when calling the code which gets the boundary review response. It then logs this to sentry, but still returns a response. This seemed better than raising a 5xx in this situation, where a client might want the rest of the information in the response, even if boundary change failed.
93fc4d4 to
aa12f29
Compare
3d4a92d to
7904efb
Compare
7904efb to
05a8eb4
Compare
GeoWill
commented
Feb 3, 2026
| data = self.get_data_for_uprn() | ||
| return self.query_to_dict(data) | ||
|
|
||
| def data_quality_check(self, postcode_df): |
Contributor
Author
There was a problem hiding this comment.
This now happens inside every request/response cycle that looks for static data.
I don't think it will add much, but it feels like the wrong place for it.
Would it be better to try and add some checks to the statemachine that run at the end of each run and do data quality assurance.
GeoWill
commented
Feb 4, 2026
| except Exception as ex: | ||
| # Log to sentry, but don't fail to return response | ||
| sentry_sdk.capture_exception(ex) | ||
| resp["boundary_reviews"] = "Error fetching boundary reviews" |
Contributor
Author
There was a problem hiding this comment.
This is different to what we did for recall petitions, but feels like it's probably more useful. i.e. say we had a problem in the API response, but still return all the other data.
GeoWill
commented
Feb 4, 2026
Comment on lines
+108
to
+109
| except FileNotFoundError: | ||
| resp["boundary_reviews"] = None |
Contributor
Author
There was a problem hiding this comment.
In these cases we should be logging the error to sentry, but not telling the user there was an error.
d2c7a10 to
f5256bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.