concept return code in category ant
appears as: return code, return codes

This is an excerpt from Manning's book Ant in Action.
You can halt a build if the return code of the program isn’t zero.
Regardless of whether the program runs in Ant’s own JVM or a new process, we can still capture the return code of the program, which can be used to pass information back to the caller or signal an error.
Sometimes, you want to know if the program returned a status code or what the value was without halting the build. Knowing this lets you do conditional actions on the return code or run programs that pass information back to Ant. To get the return code, set the resultproperty attribute to the name of a property and leave failonerror="false":