Skip to content

Commit

Permalink
o Tweaked error reporting to exclude well-known exceptions
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@902613 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bentmann committed Jan 24, 2010
1 parent 3b35b62 commit a7cf185
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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 : "";
Expand Down

0 comments on commit a7cf185

Please sign in to comment.