Package org.apache.tools.ant
Class BuildException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.tools.ant.BuildException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- BuildTimeoutException,- ExitStatusException,- UnsupportedAttributeException,- UnsupportedElementException
Signals an error condition during a build
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a build exception with no descriptive information.BuildException(String message) Constructs an exception with the given descriptive message.BuildException(String pattern, Object... formatArguments) Constructs an exception with the given format pattern and arguments.BuildException(String message, Throwable cause) Constructs an exception with the given message and exception as a root cause.BuildException(String message, Throwable cause, Location location) Constructs an exception with the given message and exception as a root cause and a location in a file.BuildException(String message, Location location) Constructs an exception with the given descriptive message and a location in a file.BuildException(Throwable cause) Constructs an exception with the given exception as a root cause.BuildException(Throwable cause, Location location) Constructs an exception with the given exception as a root cause and a location in a file.
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.Returns the file location where the error occurred.static BuildExceptionGet aBuildExceptionfor the specifiedThrowable.voidsetLocation(Location location) Sets the file location where the error occurred.toString()Returns the location of the error and the error message.Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
- 
Constructor Details- 
BuildExceptionpublic BuildException()Constructs a build exception with no descriptive information.
- 
BuildExceptionConstructs an exception with the given descriptive message.- Parameters:
- message- A description of or information about the exception. Should not be- null.
 
- 
BuildExceptionConstructs an exception with the given format pattern and arguments.- Parameters:
- pattern- A description of or information about the exception. Should not be- null.
- formatArguments- ditto
- Since:
- Ant 1.10.2
- See Also:
 
- 
BuildExceptionConstructs an exception with the given message and exception as a root cause.- Parameters:
- message- A description of or information about the exception. Should not be- nullunless a cause is specified.
- cause- The exception that might have caused this one. May be- null.
 
- 
BuildExceptionConstructs an exception with the given message and exception as a root cause and a location in a file.- Parameters:
- message- A description of or information about the exception. Should not be- nullunless a cause is specified.
- cause- The exception that might have caused this one. May be- null.
- location- The location in the project file where the error occurred. Must not be- null.
 
- 
BuildExceptionConstructs an exception with the given exception as a root cause.- Parameters:
- cause- The exception that might have caused this one. Should not be- null.
 
- 
BuildExceptionConstructs an exception with the given descriptive message and a location in a file.- Parameters:
- message- A description of or information about the exception. Should not be- null.
- location- The location in the project file where the error occurred. Must not be- null.
 
- 
BuildExceptionConstructs an exception with the given exception as a root cause and a location in a file.- Parameters:
- cause- The exception that might have caused this one. Should not be- null.
- location- The location in the project file where the error occurred. Must not be- null.
 
 
- 
- 
Method Details- 
ofGet aBuildExceptionfor the specifiedThrowable.- Parameters:
- t-
- Returns:
- BuildException
- Since:
- Ant 1.10.13
 
- 
getExceptionDeprecated.UseThrowable.getCause()instead.Returns the nested exception, if any.- Returns:
- the nested exception, or nullif no exception is associated with this one
 
- 
toStringReturns the location of the error and the error message.
- 
setLocationSets the file location where the error occurred.- Parameters:
- location- The file location where the error occurred. Must not be- null.
 
- 
getLocationReturns the file location where the error occurred.- Returns:
- the file location where the error occurred.
 
 
- 
Throwable.getCause()instead.