}
}
public static IOOptions newIOOptions(Ruby runtime, String mode) {
try {
return new IOOptions(runtime, mode);
} catch (InvalidValueException ive) {
// This is used by File and StringIO, which seem to want an ArgumentError instead of EINVAL
throw runtime.newArgumentError("illegal access mode " + mode);
}
}