openapi-fetch version
Latest
Description
The context is this code:
|
return response.ok ? { data: undefined, response } : { error: undefined, response }; |
I wonder if we shouldn't have a tru-ish value (maybe just "true") for error here, so that the calling code can simply use if (error). What do you think?
Reproduction
The problem happens when a server returns an error status (such as 405) without any content.
Expected result
The caller can do if (error) simply.
Extra
openapi-fetch version
Latest
Description
The context is this code:
openapi-typescript/packages/openapi-fetch/src/index.js
Line 235 in 12f9c29
I wonder if we shouldn't have a tru-ish value (maybe just "true") for
errorhere, so that the calling code can simply useif (error). What do you think?Reproduction
The problem happens when a server returns an error status (such as 405) without any content.
Expected result
The caller can do
if (error)simply.Extra