o Tweaked error reporting to exclude well-known exceptions

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@902613 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-01-24 17:51:37 +00:00
parent 3b35b6222a
commit a7cf185920
1 changed files with 22 additions and 1 deletions

View File

@ -205,7 +205,7 @@ else if ( exception instanceof LifecycleExecutionException )
{
reference = getReference( exception.getCause() );
}
else if ( !( exception instanceof RuntimeException ) )
else if ( isNoteworthyException( exception ) )
{
reference = exception.getClass().getSimpleName();
}
@ -219,6 +219,27 @@ else if ( !( exception instanceof RuntimeException ) )
return reference;
}
private boolean isNoteworthyException( Throwable exception )
{
if ( exception == null )
{
return false;
}
else if ( exception instanceof Error )
{
return true;
}
else if ( exception instanceof RuntimeException )
{
return false;
}
else if ( exception.getClass().getName().startsWith( "java" ) )
{
return false;
}
return true;
}
private String getMessage( String message, Throwable exception )
{
String fullMessage = ( message != null ) ? message : "";