How to use hooks in react-query global onError handler - TanStack