-
Notifications
You must be signed in to change notification settings - Fork 3
Boundary changes endpoint. #629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
| data = self.get_data_for_uprn() | ||
| return self.query_to_dict(data) | ||
|
|
||
| def data_quality_check(self, postcode_df): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| except FileNotFoundError: | ||
| resp["boundary_reviews"] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In these cases we should be logging the error to sentry, but not telling the user there was an error.
No description provided.