Isolate pass service errors & potentially log and discard invalid proposal info
Open
@stuartcampbell is already working on this.
Since May 11, 2024.
- Dominant language
- Python
- Stars
- 0
- Forks
- 13
- Avg merge
- 1h 17m
- Merged PRs (30d)
- 1
Description
Consider breaking up the try-catch blocks here (and similar uses elsewhere) to:
- Isolate the source of an error
- Possibly log and then discard invalid proposal types
For example:
try:
pass_proposal_types_list = await _call_pass_webservice(url)
except Exception as error:
error_message = "Error retrieving proposal types from PASS."
logger.exception(error_message)
raise PassException(error_message) from error
proposal_types = []
if pass_proposal_types_list and len(pass_proposal_types_list) > 0:
for proposal_type in pass_proposal_types_list:
try:
proposal_types.append(PassProposalType(**proposal_type))
except ValidationError as error:
error_message = f"Error validating data recevied from PASS for proposal type for the {facility} facility."
logger.error(error_message)
# raise PassException(error_message) from error
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.