TanStackT
TanStack3y ago
4 replies
standard-azure

Handling Error

When i make a request, when api fails i dont receive the api payload from the api that has been sent.

Here is the mutation fn
export const verifyEmail = async (token: string) => {
  const response = await axiosinstance.post("/v2/auth/verify_email", { token });
  return response.data;
};


but in error i get Request failed with status code 400 this but i want the payload that has been sent from the api... what to do and can someone point me to right direction how to utilize if api sent status code like 400, 500, how to handle error in those situation in react query
Was this page helpful?