public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
@Override public RaiseException newRaiseException(Ruby runtime) { return runtime.newRaiseException(runtime.getErrno().getClass(errnoClass), path); } }
public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
@Override public RaiseException newRaiseException(Ruby runtime) { return runtime.newRaiseException(runtime.getErrno().getClass(errnoClass), path); } }
public RaiseException newErrnoFromLastPOSIXErrno() { RubyClass errnoClass = getErrno(getPosix().errno()); if (errnoClass == null) errnoClass = systemCallError; return newRaiseException(errnoClass, null); }
public RaiseException newErrnoFromLastPOSIXErrno() { RubyClass errnoClass = getErrno(getPosix().errno()); if (errnoClass == null) errnoClass = systemCallError; return newRaiseException(errnoClass, null); }
public RaiseException newErrnoFromLastPOSIXErrno() { RubyClass errnoClass = getErrno(getPosix().errno()); if (errnoClass == null) errnoClass = systemCallError; return newRaiseException(errnoClass, null); }
public RaiseException newErrnoFromLastPOSIXErrno() { RubyClass errnoClass = getErrno(getPosix().errno()); if (errnoClass == null) errnoClass = systemCallError; return newRaiseException(errnoClass, null); }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
@JRubyMethod(name = {"unlink", "delete"}) public IRubyObject unlink(ThreadContext context) { try { return context.runtime.getDir().callMethod(context, "unlink", path); } catch (RaiseException ex) { if (!context.runtime.getErrno().getClass("ENOTDIR").isInstance(ex.getException())) { throw ex; } return context.runtime.getFile().callMethod(context, "unlink", path); } }
@JRubyMethod(name = {"unlink", "delete"}) public IRubyObject unlink(ThreadContext context) { try { return context.runtime.getDir().callMethod(context, "unlink", path); } catch (RaiseException ex) { if (!context.runtime.getErrno().getClass("ENOTDIR").isInstance(ex.getException())) { throw ex; } return context.runtime.getFile().callMethod(context, "unlink", path); } }
public static void sysFail(Ruby runtime, String message, int n) { IRubyObject arg = (message != null) ? runtime.newString(message) : runtime.getNil(); RubyClass instance = runtime.getErrno(n); if(instance == null) { instance = runtime.getSystemCallError(); throw new RaiseException((RubyException)(instance.newInstance(runtime.getCurrentContext(), new IRubyObject[]{arg, runtime.newFixnum(n)}, Block.NULL_BLOCK))); } else { throw new RaiseException((RubyException)(instance.newInstance(runtime.getCurrentContext(), new IRubyObject[]{arg}, Block.NULL_BLOCK))); } }
public static void sysFail(Ruby runtime, String message, int n) { IRubyObject arg = (message != null) ? runtime.newString(message) : runtime.getNil(); RubyClass instance = runtime.getErrno(n); if(instance == null) { instance = runtime.getSystemCallError(); throw new RaiseException((RubyException)(instance.newInstance(runtime.getCurrentContext(), new IRubyObject[]{arg, runtime.newFixnum(n)}, Block.NULL_BLOCK))); } else { throw new RaiseException((RubyException)(instance.newInstance(runtime.getCurrentContext(), new IRubyObject[]{arg}, Block.NULL_BLOCK))); } }
@JRubyMethod(name = {"unlink", "delete"}) public IRubyObject unlink(ThreadContext context) { IRubyObject oldExc = context.runtime.getGlobalVariables().get("$!"); // Save $! try { return context.runtime.getDir().callMethod(context, "unlink", getPath()); } catch (RaiseException ex) { if (!context.runtime.getErrno().getClass("ENOTDIR").isInstance(ex.getException())) { throw ex; } context.runtime.getGlobalVariables().set("$!", oldExc); // Restore $! return context.runtime.getFile().callMethod(context, "unlink", getPath()); } }
@JRubyMethod(name = {"unlink", "delete"}) public IRubyObject unlink(ThreadContext context) { IRubyObject oldExc = context.runtime.getGlobalVariables().get("$!"); // Save $! try { return context.runtime.getDir().callMethod(context, "unlink", getPath()); } catch (RaiseException ex) { if (!context.runtime.getErrno().getClass("ENOTDIR").isInstance(ex.getException())) { throw ex; } context.runtime.getGlobalVariables().set("$!", oldExc); // Restore $! return context.runtime.getFile().callMethod(context, "unlink", getPath()); } }