CharlesMangwa / react-data-fetching

🎣 Declarative data fetching for React.
https://react-data-fetching.now.sh
MIT License
491 stars 27 forks source link

Error thrown by fetch due to isUpload #33

Closed ad1992 closed 6 years ago

ad1992 commented 6 years ago

The below error is thrown when using Fetch

react-fetching-data.js:1775 Uncaught (in promise) Error: <Fetch /> tried to call the route "/home/html" with "POST" method but resolved with the following error:  .Sorry <Fetch /> couldn't turned this into a readable string. Check error.content.request to see what happened.

This happens because of the isUpload condition here https://github.com/CharlesMangwa/react-data-fetching/blob/35b8449cfb205810b756ebde61d7fb3fd50e5f49/modules/requestToApi.js#L61

So when the request.status is 0 and isUpload is true, the above exception occurs.

isUpload can be removed as when upload will be completed, request.readyState will be 4