Issue Details (XML | Word | Printable)

Key: JRUBY_EMBED-10
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: trejkaz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jruby-embed

Reduce the level of exception wrapping when an exception occurs

Created: 07/Oct/09 10:30 PM   Updated: 30/Oct/09 12:45 AM   Resolved: 30/Oct/09 12:45 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Tags: exception


 Description  « Hide

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.



trejkaz added a comment - 07/Oct/09 10:32 PM

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


yokolet added a comment - 29/Oct/09 03:10 AM

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.


trejkaz added a comment - 29/Oct/09 10:23 PM

Confirmed fixed. Thanks!


yokolet added a comment - 30/Oct/09 12:45 AM

Fixed.