Examples of newIOError()


Examples of org.jruby.Ruby.newIOError()

        try {
            SocketAddress sock = getRemoteSocket();

            if(null == sock) {
                throw runtime.newIOError("Not Supported");
            }

            return runtime.newString(sock.toString());

        } catch (BadDescriptorException e) {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

        } catch (IOException e) {
            // All errors to sysread should be SystemCallErrors, but on a closed stream
            // Ruby returns an IOError.  Java throws same exception for all errors so
            // we resort to this hack...
            if ("Socket not open".equals(e.getMessage())) {
                throw runtime.newIOError(e.getMessage());
            }

            throw runtime.newSystemCallError(e.getMessage());

        } finally {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            channel = getOpenChannel();
            try {
                SocketType.forChannel(channel).shutdownInput(channel);

            } catch (IOException e) {
                throw runtime.newIOError(e.getMessage());
            }

            openFile.setMode(openFile.getMode() & ~OpenFile.READABLE);

            return RubyFixnum.zero(runtime);
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            channel = getOpenChannel();
            try {
                SocketType.forChannel(channel).shutdownOutput(channel);

            } catch (IOException e) {
                throw runtime.newIOError(e.getMessage());
            }

            openFile.setMode(openFile.getMode() & ~OpenFile.WRITABLE);

            return RubyFixnum.zero(runtime);
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

    private void ensureReadNonBuffered() throws IOException, BadDescriptorException {
        if (reading) {
            if (buffer.hasRemaining()) {
                Ruby localRuntime = getRuntime();
                if (localRuntime != null) {
                    throw localRuntime.newIOError("sysread for buffered IO");
                } else {
                    throw new IOException("sysread for buffered IO");
                }
            }
        } else {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

                    if (cbuf.len != 0) {
                        r = StringSupport.preciseLength(read_enc, cbuf.ptr, cbuf.off, cbuf.off + cbuf.len);
                        if (!StringSupport.MBCLEN_NEEDMORE_P(r))
                            break;
                        if (cbuf.len == cbuf.capa) {
                            throw runtime.newIOError("too long character");
                        }
                    }

                    if (moreChar(context) == MORE_CHAR_FINISHED) {
                        if (cbuf.len == 0) {
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            }
            return RubyUtils.rubyObject(ruby, o);
        } catch (JsonProcessingException e) {
            throw ParseError.newParseError(ruby, e.getLocalizedMessage());
        } catch (IOException e) {
            throw ruby.newIOError(e.getLocalizedMessage());
        }
    }

    // serialize
    @JRubyMethod(module = true, name = {"generate", "dump"}, required = 1)
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            String s = mapper.writeValueAsString(obj);
            return RubyUtils.rubyString(_ruby, s);
        } catch (JsonProcessingException e) {
            throw ParseError.newParseError(_ruby, e.getLocalizedMessage());
        } catch (IOException e) {
            throw _ruby.newIOError(e.getLocalizedMessage());
        }
    }
}
View Full Code Here

Examples of org.jruby.Ruby.newIOError()

            SelectableChannel channel = (SelectableChannel)rawChannel;

            try {
                channel.configureBlocking(false);
            } catch(IOException ie) {
                throw runtime.newIOError(ie.getLocalizedMessage());
            }

            int interestOps = Nio4r.symbolToInterestOps(runtime, channel, interests);
            SelectionKey key;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.