exceptionfactory commented on code in PR #6798:
URL: https://github.com/apache/nifi/pull/6798#discussion_r1053696166
##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java:
##########
@@ -372,4 +382,27 @@ private Source getSecureSource(final StreamSource
streamSource) throws Transform
throw new TransformerConfigurationException("XSLT Source Stream
Reader creation failed", e);
}
}
+}
+
+class ErrorListenerLogger implements ErrorListener {
+ private final ComponentLog logger;
+
+ ErrorListenerLogger(ComponentLog logger) {
+ this.logger = logger;
+ }
+
+ @Override
+ public void warning(TransformerException exception) throws
TransformerException {
+ logger.warn(exception.getMessageAndLocation());
+ }
+
+ @Override
+ public void error(TransformerException exception) throws
TransformerException {
+ logger.error(exception.getMessageAndLocation());
+ }
+
+ @Override
+ public void fatalError(TransformerException exception) throws
TransformerException {
Review Comment:
Yes, but if it isn't thrown, it doesn't need to be declared on the
implementing method.
In this particular case, on further review, `fatalError` should throw the
exception to prevent further processing.
--
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]