react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

feat(android): Return response code and body when error on Android

Open zatteo opened this issue 2 years ago • 0 comments

Summary

When there was an error, plugin would just return "upload error". Now, if it is an upload error, plugin return also the response code and body. This enable user to add custom behavior when receiving an upload error depending on the server.

This PR is just forwarding response code and body from android-upload-service.

Test Plan

What's required for testing (prerequisites)?

A server that return a 4XX.

What are the steps to reproduce (after prerequisites)?

Create an upload which should fail with a 4XX. Check that the errorData contains responseCode and responseBody.

Compatibility

OS Implemented
iOS
Android

Checklist

  • [x] I have tested this on ~~a device and~~ a simulator
  • [x] I added the documentation in README.md
  • [x] I updated the typed files (TS and Flow)
  • [ ] I've added Detox End-to-End Test(s)
  • [ ] I've created a snack to demonstrate the changes

zatteo avatar Jul 26 '23 08:07 zatteo