Beispiel #1
0
        public override object Call1(Class last_class, object recv, Frame caller, Proc block, object p1)
        {
            Exception exc;

            if (p1 == null)
                exc = null;
            if (p1 is String)
                exc = new RuntimeError(((String)p1).value);
            else if (Eval.RespondTo(p1, "exception"))
                exc = (Exception)Eval.CallPrivate(p1, caller, "exception", null);
            else
                throw new TypeError("exception object expected").raise(caller);

            throw exc.raise(caller);
        }
Beispiel #2
0
        public override object Call0(Class last_class, object recv, Frame caller, Proc block)
        {
            Exception exc = (Exception)Eval.ruby_errinfo.value;

            if (exc == null)
                exc = new RuntimeError("");

            throw exc.raise(caller);
        }