-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
👋 thank you for this great module.
I noticed, that an APIError
is thrown if response.ok
is falsy:
openapi-typescript-fetch/src/fetcher.ts
Lines 163 to 167 in b62ee71
if (result.ok) { | |
return result | |
} | |
throw new ApiError(result) |
ok
is omitted in ApiError
constructor:
openapi-typescript-fetch/src/types.ts
Line 162 in b62ee71
constructor(response: Omit<ApiResponse, 'ok'>) { |
This means, that you always have true
for ok
, because it is not part of the error response.
It's not a real issue, but I expected that I could check for ok
by myself to separate abnormal HTTP-statuses (4xx, 5xx) from network problems.
I suggest removing ok
from the result, or do not throw an error if the response is not ok
.
Metadata
Metadata
Assignees
Labels
No labels