Checking for 500 server errors with useQuery - TanStack