Open senid231 opened 5 years ago
I've fixed it like this in my project:
module ImproveOperationDispatcher
def with_default_handling(&block)
block.yield
end
end
JSONAPI::OperationDispatcher.prepend(ImproveOperationDispatcher)
I think unexpected exceptions from operations should be propagated to controller where they will be rescued by handle_exceptions
method
@senid231 agreed. This is how master/v0.10 is handling it. I'd like to make sure any fix for v0.9 doesn't break existing user's code.
Wow, been wondering why handle_exceptions in the controller didn't work! Thanks for detective work!
into https://github.com/cerebris/jsonapi-resources/pull/946 followed by https://github.com/cerebris/jsonapi-resources/pull/1026 ( preceded by https://github.com/cerebris/jsonapi-resources/pull/532/files )
This issue is a (choose one):
Checklist before submitting:
Description
When unexpected error appears during create/update/destroy of resource on_server_error callback is executed within operations transaction so any database update that was done will be rollbacked (for example we send error mail via active job)
Bug reports:
execution log