-
-
Notifications
You must be signed in to change notification settings - Fork 57
[19.0[IMP] edi_core_oca: mark process integrity errors as failed #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,12 +297,19 @@ def exchange_send(self, exchange_record): | |
| return res | ||
|
|
||
| def _swallable_exceptions(self): | ||
| # TODO: improve this list | ||
| # These errors are permanent because retrying the same data will fail again. | ||
| # They should be swallowed so the exchange can move to an error state. | ||
| # | ||
| # SQL errors are handled separately: OperationalError may be transient, | ||
| # while IntegrityError requires process-specific transaction handling. | ||
| return ( | ||
| ValueError, | ||
| FileNotFoundError, | ||
| exceptions.UserError, | ||
| exceptions.ValidationError, | ||
| TypeError, | ||
| LookupError, # covers KeyError / IndexError | ||
| AttributeError, | ||
| ) | ||
|
|
||
| def _send_retryable_exceptions(self): | ||
|
|
@@ -486,7 +493,14 @@ def exchange_process(self, exchange_record): | |
| error = _get_exception_msg(err) | ||
| state = "input_processed_error" | ||
| res = f"Error: {error}" | ||
| except (OperationalError, IntegrityError): | ||
| except IntegrityError as err: | ||
|
Comment on lines
495
to
+496
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well with this change we just end up duplicating code I rechecked the code and with the changes introduced by 8f44487, Leaving OperationalError handling ( @guewen your input is welcome on this one 🙏 |
||
| 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}" | ||
| except OperationalError: | ||
| # We don't want the finally block to be executed in this case as | ||
| # the cursor is already in an aborted state and any query will fail. | ||
| res = "__sql_error__" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.