openapi-react-query version
0.5.0
Description
Due to optimization in openapi-fetch
, it can return error responses in shape of {error: undefined, response}
. React query handling code will ignore such errors, and will instead return a successful response.
Reproduction
Easy reproduction is to use a mutateAsync
on an endpoint returning empty response with an error code.
try {
await mutateAsync(); // ensure it returns 4xx or 5xx with Content-Lenght 0
console.log("This will execute");
} catch {
console.log("But this won't");
}
Expected result
Promise is not resolved, and catch code will execute.
Extra