How to throw a error in a middleware and catch it on parent middleware - TanStack