/** This method don't do anything for performance reasons. * * @see Throwable#fillInStackTrace() */ @Override public Throwable fillInStackTrace() { if (RubyInstanceConfig.JUMPS_HAVE_BACKTRACE) { return originalFillInStackTrace(); } return this; }
@Deprecated public RaiseException(Throwable cause, org.jruby.NativeException nativeException) { super(nativeException.getMessageAsJavaString(), cause); providedMessage = super.getMessage(); // cause.getClass().getId() + ": " + message setException(nativeException); preRaise(nativeException.getRuntime().getCurrentContext(), nativeException.getCause().getStackTrace()); setStackTrace(RaiseException.javaTraceFromRubyTrace(exception.getBacktraceElements())); }
private static int handleUnexpectedJump(final JumpException ex) { if ( ex instanceof JumpException.SpecialJump ) { // ex == JumpException.SPECIAL_JUMP System.err.println("Unexpected break: " + ex); } else if ( ex instanceof JumpException.FlowControlException ) { // NOTE: assuming a single global runtime main(args) should have : if ( Ruby.isGlobalRuntimeReady() ) { final Ruby runtime = Ruby.getGlobalRuntime(); RaiseException raise = ((JumpException.FlowControlException) ex).buildException(runtime); if ( raise != null ) handleRaiseException(raise); } else { System.err.println("Unexpected jump: " + ex); } } else { System.err.println("Unexpected: " + ex); } final StackTraceElement[] trace = ex.getStackTrace(); if ( trace != null && trace.length > 0 ) { System.err.println( ThreadContext.createRawBacktraceStringFromThrowable(ex, false) ); } else { System.err.println("HINT: to get backtrace for jump exceptions run with -Xjump.backtrace=true"); } // TODO: should match MRI (>= 2.2.3) exit status - @see ruby/test_enum.rb#test_first return 2; }
@Deprecated public RaiseException(Throwable cause, org.jruby.NativeException nativeException) { super(nativeException.getMessageAsJavaString(), cause); providedMessage = super.getMessage(); // cause.getClass().getId() + ": " + message setException(nativeException); preRaise(nativeException.getRuntime().getCurrentContext(), nativeException.getCause().getStackTrace()); setStackTrace(RaiseException.javaTraceFromRubyTrace(exception.getBacktraceElements())); }
private static int handleUnexpectedJump(final JumpException ex) { if ( ex instanceof JumpException.SpecialJump ) { // ex == JumpException.SPECIAL_JUMP System.err.println("Unexpected break: " + ex); } else if ( ex instanceof JumpException.FlowControlException ) { // NOTE: assuming a single global runtime main(args) should have : if ( Ruby.isGlobalRuntimeReady() ) { final Ruby runtime = Ruby.getGlobalRuntime(); RaiseException raise = ((JumpException.FlowControlException) ex).buildException(runtime); if ( raise != null ) handleRaiseException(raise); } else { System.err.println("Unexpected jump: " + ex); } } else { System.err.println("Unexpected: " + ex); } final StackTraceElement[] trace = ex.getStackTrace(); if ( trace != null && trace.length > 0 ) { System.err.println( ThreadContext.createRawBacktraceStringFromThrowable(ex, false) ); } else { System.err.println("HINT: to get backtrace for jump exceptions run with -Xjump.backtrace=true"); } // TODO: should match MRI (>= 2.2.3) exit status - @see ruby/test_enum.rb#test_first return 2; }
/** This method don't do anything for performance reasons. * * @see Throwable#fillInStackTrace() */ @Override public Throwable fillInStackTrace() { if (RubyInstanceConfig.JUMPS_HAVE_BACKTRACE) { return originalFillInStackTrace(); } return this; }
/** This method don't do anything for performance reasons. * * @see Throwable#fillInStackTrace() */ @Override public Throwable fillInStackTrace() { if (RubyInstanceConfig.JUMPS_HAVE_BACKTRACE) { return originalFillInStackTrace(); } return this; }
/** This method don't do anything for performance reasons. * * @see Throwable#fillInStackTrace() */ @Override public Throwable fillInStackTrace() { if (RubyInstanceConfig.JUMPS_HAVE_BACKTRACE) { return originalFillInStackTrace(); } return this; }