Skip to content

[19.0[IMP] edi_core_oca: mark process integrity errors as failed - #319

Open
yankinmax wants to merge 1 commit into
OCA:19.0from
camptocamp:edi_core_oca-add-exp
Open

[19.0[IMP] edi_core_oca: mark process integrity errors as failed#319
yankinmax wants to merge 1 commit into
OCA:19.0from
camptocamp:edi_core_oca-add-exp

Conversation

@yankinmax

Copy link
Copy Markdown
Contributor

No description provided.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @etobella, @simahawk,
some modules you are maintaining are being modified, check this out!

Comment thread edi_core_oca/models/edi_backend.py

@simahawk simahawk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree w/ @Ricardoalso

@yankinmax
yankinmax force-pushed the edi_core_oca-add-exp branch from af09c01 to 4b7cb23 Compare August 6, 2026 05:59
@yankinmax
yankinmax force-pushed the edi_core_oca-add-exp branch from 4b7cb23 to c088ac6 Compare August 6, 2026 06:04
@yankinmax yankinmax changed the title [19.0[IMP] edi_core_oca: swallow IntegrityError and malformed data errors [19.0[IMP] edi_core_oca: mark process integrity errors as failed Aug 6, 2026
Comment on lines 495 to +496
res = f"Error: {error}"
except (OperationalError, IntegrityError):
except IntegrityError as err:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well with this change we just end up duplicating code

if self.env.context.get("_edi_process_break_on_error"):
    raise
traceback = _get_exception_traceback()
error = _get_exception_msg(err)
state = "input_processed_error"
res = f"Error: {error}"

I rechecked the code and with the changes introduced by 8f44487,
I would keep IntegrityError inside _swallable_exceptions because it always runs inside a cr.savepoint(), which rolls back to the savepoint before this is caught, leaving the cursor usable.

Leaving OperationalError handling (res = "__sql_error__") separately as it may indicate a broken connection rather than a "bad statement".

@guewen your input is welcome on this one 🙏

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.

5 participants