private org.jruby.ext.posix.POSIX.ERRORS convert(Errno error) { try { return org.jruby.ext.posix.POSIX.ERRORS.valueOf(error.name()); } catch (IllegalArgumentException x) { return org.jruby.ext.posix.POSIX.ERRORS.EIO; // PosixException.message has real error anyway } } }, true);
@Override public void error(Errno error, String methodName, String extraData) { throw new PosixException("native error calling " + methodName + ": " + error.description() + " " + extraData, convert(error)); } private org.jruby.ext.posix.POSIX.ERRORS convert(Errno error) {
/** * Argument list too long */ public static int E2BIG() { return Errno.E2BIG.intValue(); }
/** * Permission denied */ public static int EACCES() { return Errno.EACCES.intValue(); }
@Override public void error(Errno error, String extraData) { throw new PosixException("native error " + error.description() + " " + extraData, convert(error)); } @Override public void error(Errno error, String methodName, String extraData) {
/** * Bad file number */ public static int EBADF() { return Errno.EBADF.intValue(); }
/** * Not a data message */ public static int EBADMSG() { return Errno.EBADMSG.intValue(); }
/** * Math argument out of domain of func */ public static int EDOM() { return Errno.EDOM.intValue(); }
/** * File exists */ public static int EEXIST() { return Errno.EEXIST.intValue(); }
/** * Host is down */ public static int EHOSTDOWN() { return Errno.EHOSTDOWN.intValue(); }
/** * Identifier removed */ public static int EIDRM() { return Errno.EIDRM.intValue(); }
/** * Interrupted system call */ public static int EINTR() { return Errno.EINTR.intValue(); }
/** * No such device */ public static int ENODEV() { return Errno.ENODEV.intValue(); }
/** * Exec format error */ public static int ENOEXEC() { return Errno.ENOEXEC.intValue(); }
/** * No message of desired type */ public static int ENOMSG() { return Errno.ENOMSG.intValue(); }
/** * No space left on device */ public static int ENOSPC() { return Errno.ENOSPC.intValue(); }
/** * Text file busy */ public static int ETXTBSY() { return Errno.ETXTBSY.intValue(); }
/** * Host is down */ public static int EHOSTDOWN() { return Errno.EHOSTDOWN.intValue(); }