If an atomic operation raises an error, it is currently not handled by the atomic_operations.views.AtomicOperationsView. The error that bubbles up loses any context regarding which operation failed.
I believe this should be handled here, where the index of the operation is in scope.
|
self.handle_sequential(serializer, operation_code) |
Instead, self.handle_sequential(...) calls serializer.is_valid(raise_exception=True) without handling the exception and putting the additional context in (I saw in other places there are data pointers in the form of pointer=f"{ATOMIC_OPERATIONS}/{idx}/data" being passed into the error detail).
Currently looking at how to handle it (extending the AtomicOperationsView), but I'm relatively new to the project so might not find an optimal solution.
If an atomic operation raises an error, it is currently not handled by the
atomic_operations.views.AtomicOperationsView. The error that bubbles up loses any context regarding which operation failed.I believe this should be handled here, where the index of the operation is in scope.
drf-json-api-atomic-operations/atomic_operations/views.py
Line 209 in 734cd7c
Instead,
self.handle_sequential(...)callsserializer.is_valid(raise_exception=True)without handling the exception and putting the additional context in (I saw in other places there are data pointers in the form ofpointer=f"{ATOMIC_OPERATIONS}/{idx}/data"being passed into the errordetail).Currently looking at how to handle it (extending the
AtomicOperationsView), but I'm relatively new to the project so might not find an optimal solution.