You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2005/04/19 17:38:14 UTC

BuildException wrapping in

Hi,

using

<project xmlns:au="antlib:org.apache.ant.antlib.antunit">
  <au:assertEquals expected="bar" actual="baz"/>
</project>

I get

/tmp/au.xml:2: The following error occurred while executing this line:
jar:file:/home/bodewig/ASF/jakarta/ant/sandbox/antlibs/antunit/trunk/build/lib/ant-antunit.jar!/org/apache/ant/antlib/antunit/antlib.xml:40: Expected 'bar' but was 'baz'

what I really want is

/tmp/au.xml:2:  Expected 'bar' but was 'baz'

The reason for this is that assertEquals is a <macrodef> and
MacroInstance unconditionally wraps any BuildExecption into a new one
adding the macro definition's location.

For tasks provided in antlibs, the user probably doesn't care whether
it is a macrodef or a plain task.

Would anybody object if I added an attribute to macrodef that you
could use to turn off the wrapping (default would certainly be with
wrapping)?

Another side effect of this is that an ExitStatusException thrown by
<fail> nested into <macrodef> gets turned into a plain BuildException
again.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: BuildException wrapping in

Posted by Peter Reilly <pe...@apache.org>.
see:
http://issues.apache.org/bugzilla/show_bug.cgi?id=27219#3
I had the attribute name "backtraceonerror", but I am sure
that a better name could be chosen.


Stefan Bodewig wrote:

>Hi,
>
>using
>
><project xmlns:au="antlib:org.apache.ant.antlib.antunit">
>  <au:assertEquals expected="bar" actual="baz"/>
></project>
>
>I get
>
>/tmp/au.xml:2: The following error occurred while executing this line:
>jar:file:/home/bodewig/ASF/jakarta/ant/sandbox/antlibs/antunit/trunk/build/lib/ant-antunit.jar!/org/apache/ant/antlib/antunit/antlib.xml:40: Expected 'bar' but was 'baz'
>
>what I really want is
>
>/tmp/au.xml:2:  Expected 'bar' but was 'baz'
>
>The reason for this is that assertEquals is a <macrodef> and
>MacroInstance unconditionally wraps any BuildExecption into a new one
>adding the macro definition's location.
>
>For tasks provided in antlibs, the user probably doesn't care whether
>it is a macrodef or a plain task.
>
>Would anybody object if I added an attribute to macrodef that you
>could use to turn off the wrapping (default would certainly be with
>wrapping)?
>
>Another side effect of this is that an ExitStatusException thrown by
><fail> nested into <macrodef> gets turned into a plain BuildException
>again.
>  
>
Good point!

Peter

>Stefan
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org