Skip to content

Commit b0842df

Browse files
committed
Add a couple java.io exceptions here also.
1 parent ac7a452 commit b0842df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/java/org/jruby/runtime/Helpers.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.jruby.runtime;
22

3+
import java.io.EOFException;
4+
import java.io.FileNotFoundException;
35
import java.io.IOException;
46
import java.lang.reflect.Array;
57

@@ -199,6 +201,10 @@ public static Errno errnoFromException(Throwable t) {
199201
// Try specific exception types by rethrowing and catching.
200202
try {
201203
throw t;
204+
} catch (FileNotFoundException fnfe) {
205+
return Errno.ENOENT;
206+
} catch (EOFException fnfe) {
207+
return Errno.EPIPE;
202208
} catch (AtomicMoveNotSupportedException amnse) {
203209
return Errno.EXDEV;
204210
} catch (ClosedChannelException cce) {

0 commit comments

Comments
 (0)