From 847e6b8852aaa87bac8b98df3da502842701b71e Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Mon, 21 Mar 2005 04:24:45 +0000 Subject: [PATCH] improve error handling git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163629 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/maven/DefaultMaven.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java index b80e0c05e7..1713c0ca35 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -225,9 +225,18 @@ public class DefaultMaven if ( response.isExecutionFailure() ) { // TODO: yuck! Revisit when cleaning up the exception handling from the top down - if ( response.getException() instanceof PluginExecutionException ) + Throwable exception = response.getException(); + + if ( exception instanceof PluginExecutionException ) { - logFailure( response, (PluginExecutionException) response.getException() ); + if ( exception.getCause() == null ) + { + logFailure( response, (PluginExecutionException) exception ); + } + else + { + logError( response ); + } } else {