You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/12/20 19:37:17 UTC

[GitHub] [nifi] dan-s1 commented on a diff in pull request #6798: [NIFI-6498] Set error event listener on both the TransformerFactory a…

dan-s1 commented on code in PR #6798:
URL: https://github.com/apache/nifi/pull/6798#discussion_r1053680263


##########
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:
   Isn't `throws TransformerException` part of the signature of the method interface?



-- 
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-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org