diff --git a/src/main/org/apache/tools/ant/BuildException.java b/src/main/org/apache/tools/ant/BuildException.java index 589c52502..ca7902fb5 100644 --- a/src/main/org/apache/tools/ant/BuildException.java +++ b/src/main/org/apache/tools/ant/BuildException.java @@ -165,6 +165,16 @@ public class BuildException extends RuntimeException { return cause; } + /** + * Returns the nested exception, if any. + * + * @return the nested exception, or null if no + * exception is associated with this one + */ + public Throwable getCause() { + return getException(); + } + /** * Returns the location of the error and the error message. *