birdofpreyru / react-native-fs

File system access for React Native
https://dr.pogodin.studio/docs/react-native-file-system
Other
121 stars 8 forks source link

check errorStream before inputStream for server side error response #49

Closed Crare closed 3 weeks ago

Crare commented 1 month ago

related to issue https://github.com/birdofpreyru/react-native-fs/issues/48

birdofpreyru commented 3 weeks ago

Hey @Crare , sorry for delay, I merged it now, but I also decided to slightly change related logic — in case of failure the promise returned from uploadFiles() will reject with an Error instance; if it failed due to HTTP error (status codes 4xx and 5xx) the error's message will be the reason corresponding to that status code (as per http-status-codes), and UploadResultT object will be attached to .result field of that error. It is already implemented and works for Android in dev-v2.27 branch, but it will take some more time to test in on other platforms and release.