Package org.jruby

Examples of org.jruby.RubyException


        if ( message == null ) {
            message = SQLException.class == exception.getClass() ?
                exception.getMessage() : exception.toString(); // useful to easily see type on Ruby side
        }
        final RaiseException raise = wrapException(context, getJDBCError(runtime), exception, message);
        final RubyException error = raise.getException();
        error.getMetaClass().finvoke(context, error, "errno=", runtime.newFixnum( exception.getErrorCode() ));
        error.getMetaClass().finvoke(context, error, "sql_exception=", JavaEmbedUtils.javaToRuby(runtime, exception));
        return raise;
    }
View Full Code Here


            runtime.getGlobalVariables().set(GlobalVariable.variableName("conn"), conn);
            runtime.getGlobalVariables().set(GlobalVariable.variableName("args"), JavaEmbedUtils.javaToRuby(runtime, args));
            runtime.loadFile(new File(filePath), false);
        } catch (JumpException je) {
            if (je.getJumpType() == JumpException.JumpType.RaiseJump) {
                RubyException raisedException = ((RaiseException)je).getException();

                if (raisedException.isKindOf(runtime.getClass("SystemExit"))) {
                    RubyFixnum status = (RubyFixnum)raisedException.getInstanceVariable("status");

                    if (status != null) {
                        System.exit(RubyNumeric.fix2int(status));
                    }
                } else {
View Full Code Here

    protected IRubyObject node_set(ThreadContext thread_context, String expr) {
        try {
          return tryGetNodeSet(thread_context, expr);
        } catch (XPathExpressionException xpee) {
          RubyException e = XmlSyntaxError.createXPathSyntaxError(getRuntime(), xpee);
          throw new RaiseException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jruby.RubyException

Copyright © 2018 www.massapicom. 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.