Skip to content

[16.0][FIX] edi_storage_oca: raise error if file is missing when performing receive - #391

Open
baguenth wants to merge 1 commit into
OCA:16.0from
AmetrasIntelligence:16.0-fix-edi_storage_oca-receive-storage-error
Open

baguenth wants to merge 1 commit into
OCA:16.0from
AmetrasIntelligence:16.0-fix-edi_storage_oca-receive-storage-error

Conversation

@baguenth

@baguenth baguenth commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Backport of #274 to 16.0.

When reading the pending file fails, _get_remote_file logs the error at info level and returns None; the receive step then sets the exchange record to input_received without content, and the original error is lost.

Changes (as in 18.0, adapted to the 16.0 components):

  • edi.storage.component.receive calls _get_remote_file(..., raise_if_missing=True): a missing file re-raises FileNotFoundError, a storage OSError is raised as UserError, so the record goes to input_receive_error with the reason.
  • OSError is logged as a warning with its message.
  • Other callers keep the previous behaviour (raise_if_missing defaults to False).
  • Tests added (the 18.0 change has none).

Kept as in 18.0: a failed receive is not retried automatically (the existing retry action resets the record), and exceptions outside the OSError family still escape as before.

@simahawk @etobella @ArnauCForgeFlow could you have a look?

AI assistance: prepared with Claude Code (port and tests); reviewed and tested by me.

… receive

Backport of 2ef4db3 from 18.0.

When reading the pending file failed, _get_remote_file logged the
FileNotFoundError or OSError at info level and returned None. The receive
step then stored no content but still set the exchange record to
"input_received" with "Exchange received successfully"; processing failed
later with "Record ID=... has no file to process!" and the original error
was lost.

The receive component now asks _get_remote_file to raise: a missing file
re-raises FileNotFoundError and a storage error is raised as UserError,
both swallowable by edi_oca, so the record goes to "input_receive_error"
with the reason. OSError is logged as a warning with its message. Other
callers keep the previous behaviour (raise_if_missing defaults to False).

Assisted-by: Claude Code:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants