While investigating fetch-all-awards-from-period I see that an SkippedAwardError was added in _get_awards_from_data_source 45c0f1ca
This exception class is raised by:
util.py
create_award_from_data_source (called by get_previous_awards_from_data_source)
commands.py
_create_or_update_borrower_from_data_source (called by _create_complete_application)
_create_application (called by _create_complete_application)
_get_awards_from_data_source (called by fetch_awards and fetch_all_awards_from_period)
colombia.py:
get_award (called by create_award_from_data_source)
get_borrower (called by _create_or_update_borrower_from_data_source)
get_email (called by get_borrower)
get_documento_proveedor (called by _create_or_update_borrower_from_data_source)
get_previous_awards_from_data_source and _create_complete_application use the context.
fetch_awards and fetch_all_awards_from_period do NOT use the context, so _get_awards_from_data_source should not raise this exception class. We can just raise a CredereError instead, to avoid misinterpretation. We could create a subclass for disambiguation, like SourceFormatError or something.
Or, if we want to allow processing to continue, we need to add handle_skipped_award inside the for-loop in _get_awards_from_data_source. That said, if keys are missing, it might be a sign that the response format has changed, in which case we would expect all awards to fail.
While investigating fetch-all-awards-from-period I see that an SkippedAwardError was added in _get_awards_from_data_source 45c0f1ca
This exception class is raised by:
get_previous_awards_from_data_source
and_create_complete_application
use the context.fetch_awards and fetch_all_awards_from_period do NOT use the context, so
_get_awards_from_data_source
should not raise this exception class. We can just raise aCredereError
instead, to avoid misinterpretation. We could create a subclass for disambiguation, likeSourceFormatError
or something.Or, if we want to allow processing to continue, we need to add
handle_skipped_award
inside the for-loop in_get_awards_from_data_source
. That said, if keys are missing, it might be a sign that the response format has changed, in which case we would expect all awards to fail.