-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Handle case where res.body is undefined after making a request #2847
Comments
(Or as @hugomrdias and I discussed, handle the case without throwing an error by passing res through to |
@hugomrdias Let me know if you're swayed by the argument that we can make this change and then undo it as soon as it lands upstream in React Native. Thanks! Also should we link to a tracking issue in React Native here or here? |
For now I think this serves as the tracking issue in the React Native repo facebook/react-native#27741 |
Issues related to a incomplete spec impl will be handled outside http-client, add all those links to the rn track issue I made and we will figure it out |
Ah ok, fair enough. Will do! I think the rationale for having it land here is that But I think there are plenty of valid counterpoints to that point, so we definitely can have it land outside that package. Now that this is a monorepo, are you picturing it landing in another child package in this repo or in a separate repo? I assume the latter, but just confirming. Thanks! |
Responding to @qalqi's latest comments in the old
What do you mean by this? This isn't necessarily the case. For instance, right now using
Ah okay, good to know. Thanks! FYI a big PR is about to land in
This is my experience as well -
Interesting, I haven't seen that specific error yet. Is this snippet the exact request that gave you that error? https://github.com/qalqi/react-native-ipfs-http-client/blob/fc713153239c7a99466b39a4a4890baca08b5ff5/rn-nodeify/App.js#L74-L83 So you're using
Perfect, thanks for sharing this. |
Closing this in favor of #2813 Thank you |
It would be nice if you could add error handling for if
res.body
is undefined after making a ky request.Like here, for instance:
https://github.com/ipfs/js-ipfs-http-client/blob/da9d17a38ce09d299e7180d489a56c1e276b4fb9/src/add/index.js#L43
That way in envs that need a polyfill or where a polyfill is used that doesn't implement the complete fetch spec, the error message will be more obvious.
Thanks!
The text was updated successfully, but these errors were encountered: