File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
android/src/main/java/com/RNFetchBlob Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -592,13 +592,19 @@ private void done(Response resp) {
592592 }
593593
594594 RNFetchBlobFileResp rnFetchBlobFileResp ;
595-
595+
596596 try {
597597 rnFetchBlobFileResp = (RNFetchBlobFileResp ) responseBody ;
598598 } catch (ClassCastException ex ) {
599599 // unexpected response type
600600 if (responseBody != null ) {
601- callback .invoke ("Unexpected FileStorage response file: " + responseBody .string (), null );
601+ String responseBodyString = null ;
602+ try {
603+ responseBodyString = responseBody .string ();
604+ } catch (IOException exception ) {
605+ exception .printStackTrace ();
606+ }
607+ callback .invoke ("Unexpected FileStorage response file: " + responseBodyString , null );
602608 } else {
603609 callback .invoke ("Unexpected FileStorage response with no file." , null );
604610 }
You can’t perform that action at this time.
0 commit comments