mirror of https://github.com/apache/maven.git
o Widened exception type to allow handling of errors, too
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@825512 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
759928f4d0
commit
5864960314
|
@ -269,7 +269,7 @@ public class DefaultMaven
|
||||||
return lifecycleListeners;
|
return lifecycleListeners;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MavenExecutionResult processResult( MavenExecutionResult result, Exception e )
|
private MavenExecutionResult processResult( MavenExecutionResult result, Throwable e )
|
||||||
{
|
{
|
||||||
ExceptionHandler handler = new DefaultExceptionHandler();
|
ExceptionHandler handler = new DefaultExceptionHandler();
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ Plugins:
|
||||||
public class DefaultExceptionHandler
|
public class DefaultExceptionHandler
|
||||||
implements ExceptionHandler
|
implements ExceptionHandler
|
||||||
{
|
{
|
||||||
public ExceptionSummary handleException( Exception exception )
|
public ExceptionSummary handleException( Throwable exception )
|
||||||
{
|
{
|
||||||
String message;
|
String message;
|
||||||
|
|
||||||
|
|
|
@ -21,5 +21,5 @@ package org.apache.maven.exception;
|
||||||
|
|
||||||
public interface ExceptionHandler
|
public interface ExceptionHandler
|
||||||
{
|
{
|
||||||
ExceptionSummary handleException( Exception e );
|
ExceptionSummary handleException( Throwable e );
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,20 +28,20 @@ package org.apache.maven.exception;
|
||||||
|
|
||||||
public class ExceptionSummary
|
public class ExceptionSummary
|
||||||
{
|
{
|
||||||
private Exception exception;
|
private Throwable exception;
|
||||||
|
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
private String reference;
|
private String reference;
|
||||||
|
|
||||||
public ExceptionSummary( Exception exception, String message, String reference )
|
public ExceptionSummary( Throwable exception, String message, String reference )
|
||||||
{
|
{
|
||||||
this.exception = exception;
|
this.exception = exception;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.reference = reference;
|
this.reference = reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Exception getException()
|
public Throwable getException()
|
||||||
{
|
{
|
||||||
return exception;
|
return exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,16 +81,16 @@ public class DefaultMavenExecutionResult
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List getExceptions()
|
public List<Throwable> getExceptions()
|
||||||
{
|
{
|
||||||
return exceptions == null ? Collections.EMPTY_LIST : exceptions;
|
return exceptions == null ? Collections.<Throwable> emptyList() : exceptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MavenExecutionResult addException( Throwable t )
|
public MavenExecutionResult addException( Throwable t )
|
||||||
{
|
{
|
||||||
if ( exceptions == null )
|
if ( exceptions == null )
|
||||||
{
|
{
|
||||||
exceptions = new ArrayList();
|
exceptions = new ArrayList<Throwable>();
|
||||||
}
|
}
|
||||||
|
|
||||||
exceptions.add( t );
|
exceptions.add( t );
|
||||||
|
|
|
@ -44,7 +44,7 @@ public interface MavenExecutionResult
|
||||||
// - project building exception
|
// - project building exception
|
||||||
// - invalid project model exception: list of markers
|
// - invalid project model exception: list of markers
|
||||||
// - xmlpull parser exception
|
// - xmlpull parser exception
|
||||||
List<Exception> getExceptions();
|
List<Throwable> getExceptions();
|
||||||
|
|
||||||
MavenExecutionResult addException( Throwable e );
|
MavenExecutionResult addException( Throwable e );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue