Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zatteo
Copy link

@zatteo zatteo commented Jul 26, 2023

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

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • 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

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.
zatteo added a commit to cozy/cozy-flagship-app that referenced this pull request Jul 26, 2023
server answer

This will allow to do work depending on the server answer, like file
conflict or quota exceeded.

Upstream PR : Vydia/react-native-background-upload#337
zatteo added a commit to cozy/cozy-flagship-app that referenced this pull request Jul 26, 2023
server answer

This will allow to do work depending on the server answer, like file
conflict or quota exceeded.

Upstream PR : Vydia/react-native-background-upload#337
uspython added a commit to uspython/react-native-background-upload that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant