slawekjaranowski commented on a change in pull request #486:
URL: https://github.com/apache/maven-surefire/pull/486#discussion_r823118078



##########
File path: 
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
##########
@@ -265,15 +265,18 @@ private static void throwException( 
SurefireReportParameters reportParameters, R
                                            Exception firstForkException )
             throws MojoFailureException, MojoExecutionException
     {
+        String msg = createErrorMessage( reportParameters, result, 
firstForkException );
         if ( isFatal( firstForkException ) || result.isInternalError()  )
         {
-            throw new MojoExecutionException( createErrorMessage( 
reportParameters, result, firstForkException ),
-                                                    firstForkException );
+            throw firstForkException == null
+                ? new MojoExecutionException( msg )
+                : new MojoExecutionException( msg, firstForkException );

Review comment:
       What is the difference 
   `MojoExecutionException( msg )` and `MojoExecutionException( msg, null )`
   for both `getCause()` will return null

##########
File path: 
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
##########
@@ -265,15 +265,18 @@ private static void throwException( 
SurefireReportParameters reportParameters, R
                                            Exception firstForkException )
             throws MojoFailureException, MojoExecutionException
     {
+        String msg = createErrorMessage( reportParameters, result, 
firstForkException );
         if ( isFatal( firstForkException ) || result.isInternalError()  )
         {
-            throw new MojoExecutionException( createErrorMessage( 
reportParameters, result, firstForkException ),
-                                                    firstForkException );
+            throw firstForkException == null
+                ? new MojoExecutionException( msg )
+                : new MojoExecutionException( msg, firstForkException );

Review comment:
       What is the difference 
   `MojoExecutionException( msg )` and `MojoExecutionException( msg, null )`
   for both `getCause()` will return null




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to