[16.0][FIX] edi_storage_oca: do not silently ignore OSError/FileNotFoundError #150
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.
Depends on OCA/queue#674
if an OSError is raised, there can be different cases but it's likely a transient issue (e.g. connection error):
if we ignore it as currently:
Job won't fail
the exchange record will be incorrectly marked as "input_received" but with no data, which is not what we want
so we don't ignore it anymore:
Job will fail;
the record state will stay as "input_pending" (as exception won't be catched in edi.backend:exchange_receive)
and as such, another action_exchange_receive Job will be created next time scheduled action "EDI exchange check input sync" runs, to try again to receive it, hopefully successfully this time
a RetryableJobError will be raised in order to retry it
if it sill can't succeed after max_retries, record state will be changed to "input_receive_error"
if a FileNotFoundError is raised, it's not a transient issue, so record should be marked as "input_receive_error":
to do so we don't ignore it anymore:
it will get catched in edi.backend:exchange_receive as a "swallable" (Final) error
record state will be changed to "input_receive_error"