FileNotFoundException: path (reason) - where can I find all possible "reason" messages?
Starting from Android 2.2, the FileNotFoundException contains additional information about problem:
java.io.FileNotFoundException: /foo/bar (No such file or directory)
The error message format is:
java.io.FileNotFoundException: path (reason)
I have seen such reasons:
- Invalid argument
- No space left on device
- No such file or directory
- Permission denied
- Read-only file system
Q: Where can I find all possible reason messages? Documentation, or th开发者_Python百科e source file where they are thrown from.
Exceptions like this are sort of generic, used by other classes, and will generally not contain the "reasons" that you mentioned. Any class could use a java.io.FileNotFoundException
exception, so in order to find all of the possible "reasons" you would need to search the Android source code for something like throws FileNotFoundException
or new FileNotFoundException
.
精彩评论