echo.exception.ExceptionHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of echo-maven-plugin Show documentation
Show all versions of echo-maven-plugin Show documentation
A maven plugin that outputs text during Maven build
package echo.exception;
import org.apache.maven.plugin.MojoFailureException;
/** Converts FailureExceptions to MojoFailureExceptions. The MojoFailureException will stop the maven build */
public final class ExceptionHandler {
private final FailureException fex;
/** Creates an ExceptionHandler with the exception to handle */
public ExceptionHandler(FailureException fex) {
this.fex = fex;
}
/** Throw a MojoFailureException from the failure exception */
public void throwMojoFailureException() throws MojoFailureException {
if (fex.getCause() != null) {
throw new MojoFailureException(fex.getMessage(), fex.getCause());
} else {
throw new MojoFailureException(fex.getMessage());
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy