I use rtk-query and I have a mutation query. After the query is executed, some actions are performed in the .then() block and then the error is processed in .catch().
Also, a middleware is written that catches all errors of all queries in the project and displays them as notifications for the user.
The task is to determine inside the middleware whether the .catch() block was called or not and, based on this condition, perform some actions in the middleware.
I looked inside the action objects that the middleware gives me, but there is no hint of a .catch() block.
Is this even possible?