You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/01/24 18:51:38 UTC

svn commit: r902613 - /maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java

Author: bentmann
Date: Sun Jan 24 17:51:37 2010
New Revision: 902613

URL: http://svn.apache.org/viewvc?rev=902613&view=rev
Log:
o Tweaked error reporting to exclude well-known exceptions

Modified:
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java?rev=902613&r1=902612&r2=902613&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java Sun Jan 24 17:51:37 2010
@@ -205,7 +205,7 @@
             {
                 reference = getReference( exception.getCause() );
             }
-            else if ( !( exception instanceof RuntimeException ) )
+            else if ( isNoteworthyException( exception ) )
             {
                 reference = exception.getClass().getSimpleName();
             }
@@ -219,6 +219,27 @@
         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 : "";