mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
throw FileNotFoundException from doOpen when appropriate
This commit is contained in:
parent
a56c1d8765
commit
c14bb5768e
@ -67,7 +67,11 @@ doOpen(JNIEnv* e, const char* path, int mask)
|
||||
{
|
||||
int fd = OPEN(path, mask | OPEN_MASK, S_IRUSR | S_IWUSR);
|
||||
if (fd == -1) {
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
if (errno == ENOENT) {
|
||||
throwNew(e, "java/io/FileNotFoundException", strerror(errno));
|
||||
} else {
|
||||
throwNew(e, "java/io/IOException", strerror(errno));
|
||||
}
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user