mirror of
https://github.com/apache/maven.git
synced 2025-02-07 10:38:47 +00:00
Cleaning up diagnosis output for MojoExecutionException's.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@314785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
60854c5f75
commit
06dc81b54e
@ -17,16 +17,35 @@ public String diagnose( Throwable error )
|
||||
|
||||
StringBuffer message = new StringBuffer();
|
||||
|
||||
message.append( "Error executing mojo: " ).append( mee.getSource() ).append( "\n\n" );
|
||||
message.append( mee.getLongMessage() ).append( "\n\n" );
|
||||
message.append( "Error executing mojo" );
|
||||
|
||||
Object source = mee.getSource();
|
||||
if ( source != null )
|
||||
{
|
||||
message.append( ": " ).append( mee.getSource() ).append( "\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
message.append( ".\n" );
|
||||
}
|
||||
|
||||
message.append( "\nMessage: " ).append( mee.getMessage() );
|
||||
|
||||
String longMessage = mee.getLongMessage();
|
||||
if ( longMessage != null )
|
||||
{
|
||||
message.append( "\n\n" ).append( longMessage );
|
||||
}
|
||||
|
||||
Throwable root = DiagnosisUtils.getRootCause( mee );
|
||||
|
||||
if ( root != null && root != mee )
|
||||
{
|
||||
message.append( "Root Cause: " ).append( root.getMessage() ).append( "\n\n" );
|
||||
message.append( "\n\nRoot Cause: " ).append( root.getMessage() );
|
||||
}
|
||||
|
||||
message.append( "\n\n" );
|
||||
|
||||
return message.toString();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user