Better error messages (and detect difference between internal error and configuration error)

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@588554 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 7226e4f..e5e2f7b 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -296,7 +296,7 @@
                 {
                     jarFile.delete();
 
-                    throw new MojoFailureException("Found errors, see log");
+                    throw new MojoFailureException("Error(s) found in bundle configuration");
                 }
             }
 
@@ -323,9 +323,15 @@
             // workaround for MNG-1682: force maven to install artifact using the "jar" handler
             bundleArtifact.setArtifactHandler( artifactHandlerManager.getArtifactHandler( "jar" ) );
         }
+        catch (MojoFailureException e)
+        {
+            getLog().error( e.getLocalizedMessage() );
+            throw new MojoExecutionException( "Error(s) found in bundle configuration", e );
+        }
         catch (Exception e)
         {
-            throw new MojoExecutionException("Unknown error occurred", e);
+            getLog().error( "An internal error occurred", e );
+            throw new MojoExecutionException( "Internal error in maven-bundle-plugin", e );
         }
     }