Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 0027027

Browse files
committed
Add error handling to Android download manager when file not downloaded to specified path #236
1 parent 3374fb3 commit 0027027

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -648,12 +648,13 @@ public void onReceive(Context context, Intent intent) {
648648
String customDest = options.addAndroidDownloads.getString("path");
649649
boolean exists = new File(customDest).exists();
650650
if(!exists)
651-
throw new Exception("Download manager download failed, the file does not downloaded to destination.");
651+
throw new Exception("Download manager download failed, the file did not downloaded to destination.");
652652
else
653653
this.callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, customDest);
654654

655655
} catch(Exception ex) {
656656
error = ex.getLocalizedMessage();
657+
this.callback.invoke(error, null);
657658
}
658659
}
659660
else {

0 commit comments

Comments
 (0)