jruby-embed
  1. jruby-embed
  2. JRUBY_EMBED-10

Reduce the level of exception wrapping when an exception occurs

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Component/s: None
    • Labels:
      None

      Description

      This is a change in behaviour compared to jruby-engine:

      public void testErrorBehaviourForUnknownSymbol() throws Exception {
      ScriptEngineManager manager = new ScriptEngineManager();
      ScriptEngine engine = manager.getEngineByExtension("rb");
      try

      { engine.eval("no_method_with_this_name"); fail("Expected ScriptException"); }

      catch (ScriptException e)

      { RaiseException cause = (RaiseException) e.getCause(); cause.toString(); StringWriter writer = new StringWriter(); cause.printStackTrace(new PrintWriter(writer)); assertTrue("Not seeing the expected string at the start", writer.toString().startsWith("undefined local variable or method")); }

      }

      This test now fails because there is an additional RuntimeException between the ScriptException and RaiseException. As RaiseException is already a RuntimeException it's hard to see why the extra level might have been added.

        Activity

        Hide
        trejkaz added a comment -

        Argh. I thought it was markdown, so the code is broken and now I can't edit it. Misleading signup info.

        Show
        trejkaz added a comment - Argh. I thought it was markdown, so the code is broken and now I can't edit it. Misleading signup info.
        Hide
        yokolet added a comment -

        I believe I fixed this bug in JRuby trunk e4351b8. JRuby Embed codebase is now a part of JRuby, so you can confirm the result by JRuby trunk, 1.5.0.dev. I appreciate if you report whether the bug has been fixed or not.
        If you still have the same or another problem, please file in embedding component of JRuby's Jira, not in JRuby Embed's.

        Show
        yokolet added a comment - I believe I fixed this bug in JRuby trunk e4351b8. JRuby Embed codebase is now a part of JRuby, so you can confirm the result by JRuby trunk, 1.5.0.dev. I appreciate if you report whether the bug has been fixed or not. If you still have the same or another problem, please file in embedding component of JRuby's Jira, not in JRuby Embed's.
        Hide
        trejkaz added a comment -

        Confirmed fixed. Thanks!

        Show
        trejkaz added a comment - Confirmed fixed. Thanks!
        Hide
        yokolet added a comment -

        Fixed.

        Show
        yokolet added a comment - Fixed.

          People

          • Assignee:
            Unassigned
            Reporter:
            trejkaz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: