Tibor17 commented on pull request #478: URL: https://github.com/apache/maven-surefire/pull/478#issuecomment-1054539564
You added one more branching and you call `throwException`. Why? It has to end up with the only one exception - `BUILD ERROR` with no other decision making. So it is like this: ``` if ( isBooterError( firstForkException ) ) { throwBuildError( reportParameters, result, firstForkException ); } else if ( reportParameters.isTestFailureIgnore() ) { log.error( createErrorMessage( reportParameters, result, firstForkException ) ); } else { throwException( reportParameters, result, firstForkException ); // here is further decision making only! } private static void throwBuildFailure( SurefireReportParameters reportParameters, RunResult result, Exception firstForkException ) { throw new MojoFailureException( createErrorMessage( reportParameters, result, firstForkException ), firstForkException ); } private static void throwBuildError( SurefireReportParameters reportParameters, RunResult result, Exception firstForkException ) { throw new MojoExecutionException( createErrorMessage( reportParameters, result, firstForkException ), firstForkException ); } private static void throwException( SurefireReportParameters reportParameters, RunResult result, Exception firstForkException ) throws MojoFailureException, MojoExecutionException { if ( isFatal( firstForkException ) || result.isInternalError() ) { throwBuildError( createErrorMessage( reportParameters, result, firstForkException, firstForkException ); } else { throwBuildFailure( createErrorMessage( reportParameters, result, firstForkException, firstForkException ); } } private static boolean isBooterError( Exception firstForkException ) { return firstForkException instanceof SurefireBooterForkException; } ``` -- 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