Package org.jruby.exceptions

Examples of org.jruby.exceptions.RaiseException


        private Block block;

        private IRubyObject xmldecl, doctype, stag, etag, emptytag, comment, cdata, procins;

        private RaiseException newRaiseException(RubyClass exceptionClass, String message) {
            return new RaiseException(runtime, exceptionClass, message, true);
        }
View Full Code Here


        GlobalVariable oldVariable = createIfNotDefined(oldName);
        GlobalVariable variable = (GlobalVariable)globalVariables.get(name);

        if (variable != null && oldVariable != variable && variable.isTracing()) {
            throw new RaiseException(runtime, runtime.getRuntimeError(), "can't alias in tracer", false);
        }

        globalVariables.put(name, oldVariable);
    }
View Full Code Here

        RuntimeInfo info = RuntimeInfo.forRuntime(context.getRuntime());
        RubyClass klazz = info.jsonModule.get().getClass(className);
        RubyException excptn =
            (RubyException)klazz.newInstance(context,
                new IRubyObject[] {message}, Block.NULL_BLOCK);
        return new RaiseException(excptn);
    }
View Full Code Here

            removeLoadedFeature(loadNameRubyString);
            reraiseRaiseExceptions(e);

            if(runtime.getDebug().isTrue()) e.printStackTrace(runtime.getErr());
           
            RaiseException re = newLoadErrorFromThrowable(runtime, state.searchFile, e);
            re.initCause(e);
            throw re;
        }
    }
View Full Code Here

            return context.getRuntime().getNil();
        }

        public synchronized void checkShutdown(ThreadContext context) {
            if (entries == null) {
                throw new RaiseException(context.getRuntime(), context.getRuntime().getThreadError(), "queue shut down", false);
            }
        }
View Full Code Here

            boolean should_block = true;
            if ( Arity.checkArgumentCount(context.getRuntime(), args, 0, 1) == 1 ) {
                should_block = !args[0].isTrue();
            }
            if ( !should_block && entries.size() == 0 ) {
                throw new RaiseException(context.getRuntime(), context.getRuntime().getThreadError(), "queue empty", false);
            }
            numWaiting++;
            try {
                while ( java_length() == 0 ) {
                    try {
View Full Code Here

        return recv.getRuntime().newArray(ll);
    }

    private static RaiseException newZlibError(Ruby runtime, String klass, String message) {
        RubyClass errorClass = runtime.fastGetModule("Zlib").fastGetClass(klass);
        return new RaiseException(RubyException.newException(runtime, errorClass, message), true);
    }
View Full Code Here

            return newGzipFileError(runtime, "LengthError", message);
        }
       
        private static RaiseException newGzipFileError(Ruby runtime, String klass, String message) {
            RubyClass errorClass = runtime.fastGetModule("Zlib").fastGetClass("GzipFile").fastGetClass(klass);
            return new RaiseException(RubyException.newException(runtime, errorClass, message), true);
        }
View Full Code Here

                Ruby runtime = getRuntime();

                // MRI behavior
                if (finish && flater.needsInput()) {
                    RubyClass errorClass = runtime.fastGetModule("Zlib").fastGetClass("BufError");
                    throw new RaiseException(RubyException.newException(
                            runtime, errorClass, "buffer error"), true);
                }

                try {
                    resultLength = flater.inflate(outp);
                    if (flater.needsDictionary()) {
                        RubyClass errorClass = runtime.fastGetModule("Zlib").fastGetClass("NeedDict");
                        throw new RaiseException(RubyException.newException(
                                runtime, errorClass, "need dictionary"));
                    } else {
                        if (input.getRealSize() > 0) {
                            int remaining = flater.getRemaining();
                            if (remaining > 0) {
View Full Code Here

        } else {
            exc = runtime.getNameError();
            exArgs = new IRubyObject[]{msg, symbol};
        }

        throw new RaiseException((RubyException)exc.newInstance(context, exArgs, Block.NULL_BLOCK));
    }
View Full Code Here

TOP

Related Classes of org.jruby.exceptions.RaiseException

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.