You need to add the property
attribute to the catch
tag:
<trycatch>
<try>
<echo message="Start building MyApplication.."/>
<call target="BuildApp"/>
</try>
<catch property="failure.message">
<echo message="Build MyApp.sln is failed"/>
<echo message="Failure message: ${failure.message}"/>
<fail />
</catch>
</trycatch>
You could also forward the failure message via <fail message="${failure.message}" />
.