Causes the current build script execution to fail and the script to exit with an (optional) error message.
Table B.26: Attributes
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
message
|
String
| The message to display (reason for script abort). | "No Message" | No |
msg
|
String
| Alias for message | "No Message" | No |
if
|
String
| Name of property that must be set for script to exit. | n/a | No |
unless
|
String
| Name of property that must not be set in order for script to exit.
| n/a | No |
status
|
Integer
| Exit using the specified status code; assuming the generated Exception is not caught, PHP will exit with this status. | n/a | No |
<!-- Exit w/ message -->
<fail message="Failed for some reason!" />
<!-- Exit if ${errorprop} is defined -->
<fail if="errorprop" message="Detected error!" />
<!-- Exit unless ${dontfail} prop is defined. -->
<fail unless="dontfail" message="Detected error!" />
<!-- Using a condition to achieve the same effect:
<fail message="Detected error!">
<condition>
<not>
<isset property="dontfail"/>
</not>
</condition>
</fail>