Skip to content

Commit

Permalink
[bugfix]: clearly error message
Browse files Browse the repository at this point in the history
  • Loading branch information
zjkhiyori committed Apr 10, 2019
1 parent 2cc1159 commit 77dc006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android/src/main/java/com/rnfs/RNFSManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private InputStream getInputStream(String filepath) throws IORejectionException
try {
stream = reactContext.getContentResolver().openInputStream(uri);
} catch (FileNotFoundException ex) {
throw new IORejectionException("ENOENT", "ENOENT: no such file or directory, open '" + filepath + "'");
throw new IORejectionException("ENOENT", "ENOENT: " + ex.getMessage() + ", open '" + filepath + "'");
}
if (stream == null) {
throw new IORejectionException("ENOENT", "ENOENT: could not open an input stream for '" + filepath + "'");
Expand All @@ -117,7 +117,7 @@ private OutputStream getOutputStream(String filepath, boolean append) throws IOR
try {
stream = reactContext.getContentResolver().openOutputStream(uri, append ? "wa" : "w");
} catch (FileNotFoundException ex) {
throw new IORejectionException("ENOENT", "ENOENT: no such file or directory, open '" + filepath + "'");
throw new IORejectionException("ENOENT", "ENOENT: " + ex.getMessage() + ", open '" + filepath + "'");
}
if (stream == null) {
throw new IORejectionException("ENOENT", "ENOENT: could not open an output stream for '" + filepath + "'");
Expand Down

0 comments on commit 77dc006

Please sign in to comment.