How to handle error exception normally?


Normally how do you guys handle background exception?

Example for email notification:

I would like to have “Failed” send state and the error message save to the record send for easy tracking.
However, when I implement try exception, then it will show on the normally log or sentry.
If I save the failed state and raise_error(), the failed state will roll back.

The reason put all errors at the sentry because, the administrator only monitor in one place.
Normally cron will execute all the records. But if one record failed, all record will not be executed. I want to isolate the failed record and so that other record can be run normally.

Next, how to record the warning message?
Example: digit set (6,2). sometime by decimal, it may become 1,699999… It can show in screen but background it will not be log, but it will failed. It make harder to trace.

If you want to have error handler per record, you should execute a transaction per each record. There is an example on the account_fr_chorus module.

Note that this has a performance drawback as tryton is optimized to work on a list of records.

Normally this is implemented when there is an external service where we send the data and we must keep the state in sync. Is this your use case?