Examples of NativeException


Examples of org.jruby.NativeException

        try {
            //call throwException via JRuby
            JavaEmbedUtils.invokeMethod(runtime, wrappedThrower, "throwException", new Object[] { }, Object.class);
        } catch(final RaiseException e) {
            exceptionThrown = true;
            final NativeException ne = (NativeException) e.getException();
            final ExpectedException ee = (ExpectedException) ne.getCause();
            assertEquals("The unpacked exception we receive should be the one we threw.",
                         ExceptionThrower.expectedException,ee);
        } finally {
            assertTrue("Java Exception should have been thrown and wrapped as a RaiseException",exceptionThrown);
        }
View Full Code Here

Examples of org.jruby.NativeException

        try {
            //call throwException via JRuby
            JavaEmbedUtils.invokeMethod(runtime, wrappedThrower, "throwException", new Object[] { }, Object.class);
        } catch(final RaiseException e) {
            exceptionThrown = true;
            final NativeException ne = (NativeException) e.getException();
            final ExpectedException ee = (ExpectedException) ne.getCause();
            assertEquals("The unpacked exception we receive should be the one we threw.",
                         ExceptionThrower.expectedException,ee);
        } finally {
            assertTrue("Java Exception should have been thrown and wrapped as a RaiseException",exceptionThrown);
        }
View Full Code Here

Examples of org.jruby.NativeException

    public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause) {
        return createNativeRaiseException(runtime, cause, null);
    }

    public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause, Member target) {
        NativeException nativeException = new NativeException(runtime, runtime.getClass(NativeException.CLASS_NAME), cause);
        if (!runtime.getDebug().isTrue()) {
            nativeException.trimStackTrace(target);
        }
        return new RaiseException(cause, nativeException);
    }
View Full Code Here

Examples of org.jruby.NativeException

    public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause) {
        return createNativeRaiseException(runtime, cause, null);
    }

    public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause, Member target) {
        NativeException nativeException = new NativeException(runtime, runtime.getNativeException(), cause);

        // FIXME: someday, add back filtering of reflection/handle methods between JRuby and target

        return new RaiseException(cause, nativeException);
    }
View Full Code Here

Examples of org.jruby.NativeException

            if (RuntimeHelpers.isJavaExceptionHandled(throwable, exceptions, context).isTrue()) {
                IRubyObject exceptionObj;

                if (exceptions.length == 1 && exceptions[0] == runtime.getNativeException()) {
                    // wrap Throwable in a NativeException object
                    exceptionObj = new NativeException(runtime, runtime.getNativeException(), throwable);
                    ((NativeException)exceptionObj).prepareIntegratedBacktrace(context, throwable.getStackTrace());
                } else {
                    // wrap as normal JI object
                    exceptionObj = JavaUtil.convertJavaToUsableRubyObject(runtime, throwable);
                }
View Full Code Here

Examples of org.jruby.NativeException

    public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause) {
        return createNativeRaiseException(runtime, cause, null);
    }

    public static RaiseException createNativeRaiseException(Ruby runtime, Throwable cause, Member target) {
        NativeException nativeException = new NativeException(runtime, runtime.getNativeException(), cause);

        // FIXME: someday, add back filtering of reflection/handle methods between JRuby and target

        return new RaiseException(cause, nativeException);
    }
View Full Code Here

Examples of org.jruby.NativeException

        }
    }

    private static RaiseException newNativeException(final Ruby runtime, final Throwable cause) {
        RubyClass nativeClass = runtime.getClass(NativeException.CLASS_NAME);
        NativeException nativeException = new NativeException(runtime, nativeClass, cause);
        return new RaiseException(cause, nativeException);
    }
View Full Code Here

Examples of railo.runtime.exp.NativeException

      pageContext.forceWrite("<html>\n<head>\n\t<title>Document Moved</title>\n");
      //pageContext.forceWrite("\t<script>window.location='"+JSStringFormat.invoke(url)+"';</script>\n");
      pageContext.forceWrite("</head>\n<body>\n\t<h1>Object Moved</h1>\n\t     <a HREF=\""+url+"\">here</a>\n");
      pageContext.forceWrite("</body>\n</html>");
    } catch (IOException e) {
      throw new NativeException(e);
    }
        if(pageContext.getConfig().debug())pageContext.getDebugger().setOutput(false);
    throw new Abort(Abort.SCOPE_REQUEST);
  }
View Full Code Here

Examples of railo.runtime.exp.NativeException

        return mi.invoke(obj);
        }
    catch (InvocationTargetException e) {
      Throwable target = e.getTargetException();
      if(target instanceof PageException) throw (PageException)target;
      throw new NativeException(e.getTargetException());
    }
    catch (Exception e) {
      throw new NativeException(e);
    }
  }
View Full Code Here

Examples of railo.runtime.exp.NativeException

        return new MissingIncludeException(ps);
    }
   
    @Override
    public PageException createNativeException(Throwable t) {
        return new NativeException(t);
    }
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.