|
@@ -591,7 +591,17 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
|
591
|
591
|
// ignored.printStackTrace();
|
592
|
592
|
}
|
593
|
593
|
|
594
|
|
- RNFetchBlobFileResp rnFetchBlobFileResp = (RNFetchBlobFileResp) responseBody;
|
|
594
|
+ try {
|
|
595
|
+ RNFetchBlobFileResp rnFetchBlobFileResp = (RNFetchBlobFileResp) responseBody;
|
|
596
|
+ } catch (ClassCastException ex) {
|
|
597
|
+ // unexpected response type
|
|
598
|
+ if (responseBody != null) {
|
|
599
|
+ callback.invoke("Unexpected FileStorage response file: " + responseBody.string(), null);
|
|
600
|
+ } else {
|
|
601
|
+ callback.invoke("Unexpected FileStorage response with no file.", null);
|
|
602
|
+ }
|
|
603
|
+ return;
|
|
604
|
+ }
|
595
|
605
|
|
596
|
606
|
if(rnFetchBlobFileResp != null && !rnFetchBlobFileResp.isDownloadComplete()){
|
597
|
607
|
callback.invoke("Download interrupted.", null);
|