Examples of newRuntimeError()


Examples of org.jruby.Ruby.newRuntimeError()

                    ruby_entity.init(e);
                    array.append(ruby_entity);
                }
                return array;
            } catch (Throwable t) {
                throw runtime.newRuntimeError("Datomic Error: " + t.getMessage());
            }
        } else {
            throw runtime.newArgumentError("Arguments should be 'database, dbid, query_string'");
        }
    }
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

            posix.getpwent();
            if(block.isGiven()) {
                ThreadContext context = runtime.getCurrentContext();
               
                if (!iteratingPasswd.compareAndSet(false, true)) {
                    throw runtime.newRuntimeError("parallel passwd iteration");
                }
               
                posix.setpwent();
                try {
                    Passwd pw;
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

    @JRubyMethod(module = true)
    public static IRubyObject result(ThreadContext context, IRubyObject self) {
        Ruby runtime = context.runtime;
       
        if (!runtime.getCoverageData().isCoverageEnabled()) {
            throw runtime.newRuntimeError("coverage measurement is not enabled");
        }
       
        Map<String, int[]> coverage = runtime.getCoverageData().resetCoverage(runtime);
       
        // populate a Ruby Hash with coverage data
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        }

        if (block.isGiven()) {
            Boolean blocking = (Boolean)recv.getInternalVariables().getInternalVariable("group_blocking");
            if (blocking != null && blocking) {
                throw runtime.newRuntimeError("parallel group iteration");
            }
            try {
                recv.getInternalVariables().setInternalVariable("group_blocking", true);

                ThreadContext context = runtime.getCurrentContext();
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

       
        if (opthash == null || opthash.isNil()) {
            replacement = context.nil;
        } else {
            if (!(opthash instanceof RubyHash) || !opthash.isFrozen()) {
                throw runtime.newRuntimeError("bug: EncodingUtils.econvOpenOpts called with invalid opthash");
            }
            replacement = ((RubyHash)opthash).op_aref(context, runtime.newSymbol("replace"));
        }
       
        EConv ec = TranscoderDB.open(sourceEncoding, destinationEncoding, ecflags);
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        ClassData classData = (ClassData) ffiHandle;

        // If no release method is defined, then memory leaks will result.
        DynamicMethod releaseMethod = classData.releaseCallSite.retrieveCache(getMetaClass().getMetaClass(), classData.releaseCallSite.getMethodName()).method;
        if (releaseMethod.isUndefined()) {
            throw runtime.newRuntimeError("release method undefined");

        } else if ((releaseMethod.getArity().isFixed() && releaseMethod.getArity().required() != 1) || releaseMethod.getArity().required() > 1) {
            throw runtime.newRuntimeError("wrong number of arguments to release method ("
                    + 1 + " for " + releaseMethod.getArity().required()  + ")");
        }
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        DynamicMethod releaseMethod = classData.releaseCallSite.retrieveCache(getMetaClass().getMetaClass(), classData.releaseCallSite.getMethodName()).method;
        if (releaseMethod.isUndefined()) {
            throw runtime.newRuntimeError("release method undefined");

        } else if ((releaseMethod.getArity().isFixed() && releaseMethod.getArity().required() != 1) || releaseMethod.getArity().required() > 1) {
            throw runtime.newRuntimeError("wrong number of arguments to release method ("
                    + 1 + " for " + releaseMethod.getArity().required()  + ")");
        }


        setMemoryIO(((Pointer) pointerArg).getMemoryIO());
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

            (XsltStylesheet) NokogiriService.XSLT_STYLESHEET_ALLOCATOR.allocate(runtime, (RubyClass)klazz);

        try {
            xslt.init(args[1], doc);
        } catch (TransformerConfigurationException ex) {
            throw runtime.newRuntimeError("could not parse xslt stylesheet");
        }

        return xslt;
    }
   
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

   
    private static void ensureDocumentHasNoError(ThreadContext context, XmlDocument xmlDoc) {
        Ruby runtime = context.getRuntime();
        RubyArray errors_of_xmlDoc = (RubyArray) xmlDoc.getInstanceVariable("@errors");
        if (!errors_of_xmlDoc.isEmpty()) {
            throw runtime.newRuntimeError(errors_of_xmlDoc.first().asString().asJavaString());
        }
    }

    @JRubyMethod
    public IRubyObject serialize(ThreadContext context, IRubyObject doc) {
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

            result = tryXsltTransformation(context, args, domSource, elistener); // DOMResult
            if (result.getNode().getFirstChild() == null) {
                stringResult = retryXsltTransformation(context, args, domSource, elistener); // StreamResult
            }
        } catch(TransformerConfigurationException ex) {
            throw runtime.newRuntimeError(ex.getMessage());
        } catch(TransformerException ex) {
            throw runtime.newRuntimeError(ex.getMessage());
        } catch (IOException ex) {
            throw runtime.newRuntimeError(ex.getMessage());
        }
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.