T
TanStack3y ago
graceful-blue

useMutation is returning success on fetch error using Fetch API

Hey, I am trying to signup using a previously used credentials so, I am getting a network error 409 conflict but, useMutation is not returning an error! It is returning success instead with the error data inside the body the following
{
"data": {
"body": null,
"statusCode": 409,
"message": "The email abdo15554+6@gmail.com is already in use"
},
"error": null,
"failureCount": 0,
"isPaused": false,
"status": "success",
"variables": {
"email": "abdo15554+6@gmail.com",
"password": "12345"
},
"isLoading": false,
"isSuccess": true,
"isError": false,
"isIdle": false
}
{
"data": {
"body": null,
"statusCode": 409,
"message": "The email abdo15554+6@gmail.com is already in use"
},
"error": null,
"failureCount": 0,
"isPaused": false,
"status": "success",
"variables": {
"email": "abdo15554+6@gmail.com",
"password": "12345"
},
"isLoading": false,
"isSuccess": true,
"isError": false,
"isIdle": false
}
Also, the event onError is not fired at all! Any suggestion?
1 Reply
noble-gold
noble-gold3y ago

Did you find this page helpful?