adangel commented on code in PR #728:
URL: https://github.com/apache/maven-pmd-plugin/pull/728#discussion_r3977204565
##########
src/main/java/org/apache/maven/plugins/pmd/exec/CpdReportConsumer.java:
##########
@@ -83,7 +83,12 @@ private void writeXmlReport(CPDReport cpd) throws
IOException {
}
private void writeFormattedReport(CPDReport cpd) throws IOException,
MavenReportException {
- CPDReportRenderer renderer =
CpdExecutor.createRenderer(request.getFormat(), request.getOutputEncoding());
+ CPDReportRenderer renderer = null;
+ try {
+ renderer = CpdExecutor.createRenderer(request.getFormat(),
request.getOutputEncoding());
+ } catch (PmdException e) {
+ throw new MavenReportException(e.getMessage(), e);
+ }
writeReport(cpd, renderer, request.getFormat());
Review Comment:
Wrap the whole block inside a try catch for readability
--
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]