Skip to content

Commit

Permalink
Add a couple java.io exceptions here also.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 6, 2018
1 parent ac7a452 commit b0842df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/runtime/Helpers.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jruby.runtime;

import java.io.EOFException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Array;

Expand Down Expand Up @@ -199,6 +201,10 @@ public static Errno errnoFromException(Throwable t) {
// Try specific exception types by rethrowing and catching.
try {
throw t;
} catch (FileNotFoundException fnfe) {
return Errno.ENOENT;
} catch (EOFException fnfe) {
return Errno.EPIPE;
} catch (AtomicMoveNotSupportedException amnse) {
return Errno.EXDEV;
} catch (ClosedChannelException cce) {
Expand Down

0 comments on commit b0842df

Please sign in to comment.