Browse Source

add static BuildException factory method

master
Matt Benson 3 years ago
parent
commit
71f44247d4
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      src/main/org/apache/tools/ant/BuildException.java

+ 12
- 0
src/main/org/apache/tools/ant/BuildException.java View File

@@ -24,6 +24,18 @@ public class BuildException extends RuntimeException {

private static final long serialVersionUID = -5419014565354664240L;

/**
* Get a {@link BuildException} for the specified {@link Throwable}.
* @param t
* @return {@link BuildException}
*/
public static BuildException of(Throwable t) {
if (t instanceof BuildException) {
return (BuildException) t;
}
return new BuildException(t);
}

/** Location in the build file where the exception occurred */
private Location location = Location.UNKNOWN_LOCATION;



Loading…
Cancel
Save