WIP: Harvesting 2.0 Error Handling
Purpose
We want to have robust error handling in harvesting2.0, but we're not sure how to do that.
Given above design questions, conducting prototyping of logging and capturing errors for future analysis in a database is needed.
2 days of effort has been allocated and once compete, findings will be demonstrated and specific future actions will be decided.
Acceptance Criteria
[ACs should be clearly demo-able/verifiable whenever possible. Try specifying them using BDD.]
- [ ] GIVEN the https://github.com/GSA/datagov-harvesting-logic is utilized
WHEN 2 days expires
THEN a PR is created demonstrating error handling best practices
AND the team agrees on a future error handling process
Background
https://github.com/GSA/datagov-harvesting-logic/pull/7#discussion_r1198319450
Sketch
We considered both a class and helper function process. We want to follow railway oriented programming, but not sure the best python way of doing that. We found some examples of a pythonic-railway, and would like to investigate implementing currying as well.
I think this seems like a more complete approach: https://returns.readthedocs.io/en/latest/pages/railway.html
Or this one: https://toolz.readthedocs.io/en/latest/curry.html
Utilize one of the above libraries, and test out what the approach would look like. Get feedback and/or present to the team on how it works.
railway branch. notes are in harvester/utils/railway.py and harvester/extract/init.py