gnodet commented on code in PR #1628: URL: https://github.com/apache/maven/pull/1628#discussion_r1712795232
########## maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java: ########## @@ -143,7 +143,7 @@ public void executeMojo(MavenSession session, MojoExecution mojoExecution) mojoExecutionListener.beforeMojoExecution(mojoExecutionEvent); mojo.execute(); mojoExecutionListener.afterMojoExecutionSuccess(mojoExecutionEvent); - } catch (ClassCastException e) { + } catch (ClassCastException | MojoException e) { Review Comment: `MojoException` is actually a `RuntimeException`, so the outer catch block needs to be enhanced to rethrow directly instead of calling `mojoExecutionListener.afterExecutionFailure`. Just to keep the old behaviour. ########## maven-core/src/main/java/org/apache/maven/plugin/DefaultBuildPluginManager.java: ########## @@ -143,7 +143,7 @@ public void executeMojo(MavenSession session, MojoExecution mojoExecution) mojoExecutionListener.beforeMojoExecution(mojoExecutionEvent); mojo.execute(); mojoExecutionListener.afterMojoExecutionSuccess(mojoExecutionEvent); - } catch (ClassCastException e) { + } catch (ClassCastException | MojoException e) { Review Comment: Also, I would extend to any `MavenException`, since those are rather expected conditions. -- 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