# <fail>

[This is preliminary documentation and subject to change.]

Exits the current build by throwing a BuildException, optionally printing additional information.

The cause of the build failure can be specified using the `message` attribute or as inline content.

Macros in the message will be expanded.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
message | string | A message giving further information on why the build exited. | False
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False
unless | bool | Opposite of `if`. If false then the task will be executed; otherwise, skipped. The default is false. | False
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False

### Examples

- Exits the current build without giving further information.

      <fail />

- Exits the current build and writes a message to the build log.

      <fail message="Something wrong here." />

- Functionally equivalent to the previous example.

      <fail>Something wrong here.</fail>

### Requirements

Assembly: NAnt.Core (0.91.3881.0)