svn commit: r647551 - /lenya/sandbox/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Sun Apr 13 02:41:43 2008
New Revision: 647551

URL: http://svn.apache.org/viewvc?rev=647551&view=rev
Log:
Don't fail if ChangeNotifier can't read XML from documents.

Modified:
    lenya/sandbox/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java

Modified: lenya/sandbox/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java?rev=647551&r1=647550&r2=647551&view=diff
==============================================================================
--- lenya/sandbox/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java (original)
+++ lenya/sandbox/modules/diff/java/src/org/apache/lenya/modules/diff/ChangeNotifier.java Sun Apr 13 02:41:43 2008
@@ -116,8 +116,17 @@
         Revision rev1 = history.getRevision(revNr1);
         Revision rev2 = history.getRevision(revNr2);
 
-        org.w3c.dom.Document xml1 = DocumentHelper.readDocument(rev1.getInputStream());
-        org.w3c.dom.Document xml2 = DocumentHelper.readDocument(rev2.getInputStream());
+        org.w3c.dom.Document xml1 = null;
+        org.w3c.dom.Document xml2 = null;
+        
+        try {
+            xml1 = DocumentHelper.readDocument(rev1.getInputStream());
+            xml2 = DocumentHelper.readDocument(rev2.getInputStream());
+        }
+        catch (Exception e) {
+            getLogger().info("Can't read XML content from document " + doc);
+            return;
+        }
 
         if (xml1 == null || xml2 == null) {
             getLogger().debug("Can't compare revisions for document " + doc);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.