Examples of newArgumentError()


Examples of org.jruby.Ruby.newArgumentError()

                    result = method.call(runtime.getCurrentContext(), self, self.getMetaClass(), name, newArgs);
                } else if (m.hasSuperImplementation()) {
                    RubyClass superClass = self.getMetaClass().getSuperClass();
                    result = RuntimeHelpers.invokeAs(runtime.getCurrentContext(), superClass, self, name, newArgs, Block.NULL_BLOCK);
                } else {
                    throw runtime.newArgumentError(newArgs.length, v);
                }
                if (m.getReturnType() == void.class) {
                    return null;
                } else {
                    return result.toJava(m.getReturnType());
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

        if(len == 0) {
            str.clear();
            return str;
        }
        if (len < 0) {
            throw runtime.newArgumentError("negative string size (or size too big)");
        }

        try {
            // So we need to make sure to only block when there is no data left to process
            if (engine == null || !(peerAppData.hasRemaining() || peerNetData.position() > 0)) {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                }
            }
        }

        if (javaClass == null) {
            throw runtime.newArgumentError("unable to create proxy class: no java_class defined for " + clazz);
        }
       
        int interfaceCount = interfaceList.size();
        Class<?>[] interfaces = new Class<?>[interfaceCount];
        for (int i = interfaceCount; --i >= 0; ) {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

        try {
            connectionUri = driver.parseConnectionURI(uri);
        } catch (URISyntaxException ex) {
            //XXX Nothing to close
            throw runtime.newArgumentError("Malformed URI: " + ex);
        } catch (UnsupportedEncodingException ex) {
            //XXX Nothing to close
            throw runtime.newArgumentError("Unsupported Encoding in Query Parameters" + ex);
        }
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

        } catch (URISyntaxException ex) {
            //XXX Nothing to close
            throw runtime.newArgumentError("Malformed URI: " + ex);
        } catch (UnsupportedEncodingException ex) {
            //XXX Nothing to close
            throw runtime.newArgumentError("Unsupported Encoding in Query Parameters" + ex);
        }

        if (connectionUri.getQuery() != null) {
            try {
                query = parseQueryString(connectionUri.getQuery());
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

        if (connectionUri.getQuery() != null) {
            try {
                query = parseQueryString(connectionUri.getQuery());
            } catch (UnsupportedEncodingException ex) {
                //XXX Nothing to close
                throw runtime.newArgumentError("Unsupported Encoding in Query Parameters" + ex);
            }

            if (driver.supportsConnectionEncodings()) {
                encoding = query.get("encoding");
                if (encoding == null) {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                inferTypes = true;
            } else if (fieldTypes.size() != columnCount) {
                // Wrong number of fields passed to set_types. Close the reader
                // and raise an error.
                api.callMethod(reader, "close");
                throw runtime.newArgumentError(String.format("Field-count mismatch. Expected %1$d fields, but the query yielded %2$d",
                        fieldTypes.size(), columnCount));
            }

            // for each field
            for (int i = 0; i < columnCount; i++) {
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

            } else if (arg instanceof RubyArray) {
                for (IRubyObject sub_arg : arg.convertToArray().toJavaArray()) {
                    if (sub_arg instanceof RubyClass) {
                        fieldTypes.add(RubyType.getRubyType((RubyClass) sub_arg));
                    } else {
                        throw runtime.newArgumentError("Invalid type given");
                    }
                }
            } else {
                throw runtime.newArgumentError("Invalid type given");
            }
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                    } else {
                        throw runtime.newArgumentError("Invalid type given");
                    }
                }
            } else {
                throw runtime.newArgumentError("Invalid type given");
            }
        }

        return types;
    }
View Full Code Here

Examples of org.jruby.Ruby.newArgumentError()

                    DHParameterSpec spec = PEMInputOutput.readDHParameters(new StringReader(arg0.toString()));
                    if (spec == null) {
                        spec = org.jruby.ext.openssl.impl.PKey.readDHParameter(arg0.asString().getByteList().bytes());
                    }
                    if (spec == null) {
                        throw runtime.newArgumentError("invalid DH PARAMETERS");
                    }
                    this.dh_p = spec.getP();
                    this.dh_g = spec.getG();
                } catch (NoClassDefFoundError ncdfe) {
                    throw newDHError(runtime, OpenSSLReal.bcExceptionMessage(ncdfe));
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.