Open
Description
openapi-fetch may return an error of value undefined
, when content length is 0 and response is not okay:
openapi-typescript/packages/openapi-fetch/src/index.js
Lines 205 to 208 in d4689b1
However, openapi-react-query does not propagate this error, because the error is only propagated when error
is truthy, as per this code:
openapi-typescript/packages/openapi-react-query/src/index.ts
Lines 118 to 120 in d4689b1
To fix this, I believe this if (error)
check should be if (!response.ok)
and/or if ('error' in result)
.
We might also want to consider whether it makes sense for openapi-fetch to return undefined
as an error, in the scenario mentioned above.