Copilot commented on code in PR #561:
URL: https://github.com/apache/maven-jar-plugin/pull/561#discussion_r3610957095


##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -288,8 +289,7 @@ public Path createArchive() throws MojoException {
             archiver.createArchive(session, project, archive);
 
             return jarFile;
-        } catch (Exception e) {
-            // TODO: improve error handling
+        } catch (MavenArchiverException | ArchiverException e) {
             throw new MojoException("Error assembling JAR", e);

Review Comment:
   The PR title/description state the catch is narrowed to only 
MavenArchiverException and that ArchiverException is a RuntimeException that 
can propagate without being caught. In plexus-archiver, ArchiverException is a 
checked exception (extends Exception), and this change actually introduces a 
multi-catch for both MavenArchiverException and ArchiverException. Please 
update the PR metadata to reflect the real exception types/intent (or adjust 
the code if the intent is different).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to