Skip to content

Commit 9a168bf

Browse files
Add try catch
1 parent 09ae8f5 commit 9a168bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,11 @@ private void done(Response resp) {
598598
} catch (ClassCastException ex) {
599599
// unexpected response type
600600
if (responseBody != null) {
601-
callback.invoke("Unexpected FileStorage response file: " + responseBody.string(), null);
601+
try {
602+
callback.invoke("Unexpected FileStorage response file: " + responseBody.string(), null);
603+
} catch (IOException e) {
604+
e.printStackTrace();
605+
}
602606
} else {
603607
callback.invoke("Unexpected FileStorage response with no file.", null);
604608
}

0 commit comments

Comments
 (0)