Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Add option to stop swallowing errors on callbacks. #16537
Seconds take of #14488 .
After the transaction refactor, we can cleanly apply this patch, as we have a better control of the stack of transactions, and we know that even when raising errors, the transaction wont leaky into the stack.
Add option to stop swallowing standard errors on
# For not swallow errors in after_commit/after_rollback callbacks. config.active_record.errors_in_transactional_callbacks = true
The option should be removed in future versions of Rails, as the desired
@chancancode I guess I addressed all your concerns:
Currently, Active Record will rescue any errors raised within after_rollback/after_create callbacks and print them to the logs. Next versions of rails will not rescue those errors anymore, and just bubble them up, as the other callbacks. This adds a opt-in flag to enable that behaviour, of not rescuing the errors. Example: # For not swallow errors in after_commit/after_rollback config.active_record.errors_in_transactional_callbacks = true [fixes #13460]