https://issues.apache.org/bugzilla/show_bug.cgi?id=47509
Summary: Exception in scriptdef prints entire stack trace
Product: Ant
Version: 1.7.1
Platform: PC
OS/Version: Windows 98
Status: NEW
Severity: normal
Priority: P2
Component: Optional Tasks
AssignedTo: [email protected]
ReportedBy: [email protected]
When I run a scriptdef like:
<scriptdef name="quickfail" language="beanshell">
<![CDATA[
self.fail("I failed!");
]]>
</scriptdef>
I expect to get an output like:
BUILD FAILED
C:\myproject\build.xml:10: [quickfail] I failed!
Or something of the sort... Instead I get:
BUILD FAILED
javax.script.ScriptException: Sourced file: inline evaluation of:
``self.fail("I failed!"); ;'' : Method Invocation
self.fail : at Line: 3 : in file: inline evaluation of: ``
self.fail("I failed!");
'' : self .fail ( "I failed!" );
Target exception: I failed!
in inline evaluation of: `` self.fail("I
failed!");
at line number 3 '';
at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:86)
at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
.BshScriptEngine.evalSource(BshScriptEngine.java:86)
at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
[...it keeps going for 3 more pages, making the original error very hard to
read...]
I'm willing to grudgingly accept such an output for an IOException, or even a
syntax error, but for a user-generated fail? What's the point of providing a
custom fail command if it looks like a full system crash?
I haven't checked if this is beanshell specific, or if it applies to javascript
and other languages as well, since I only have beanshell installed.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.