abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r524805 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
Date Mon, 02 Apr 2007 15:51:04 GMT
Author: jmsnell
Date: Mon Apr  2 08:51:03 2007
New Revision: 524805

URL: http://svn.apache.org/viewvc?view=rev&rev=524805
Log:
Throw a ParseException instead of OMException when dealing with invalid XML.

e.g.,

  entry.setContent("<a><b><c d /></b></a>", "application/foo+xml");
  
Used to throw an OMException.  Now it throws ParseException.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java?view=diff&rev=524805&r1=524804&r2=524805
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
Mon Apr  2 08:51:03 2007
@@ -27,6 +27,7 @@
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Text;
+import org.apache.abdera.parser.ParseException;
 import org.apache.abdera.parser.ParserOptions;
 import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMConstants;
@@ -240,13 +241,15 @@
                 lastNode = createOMText(XMLStreamConstants.ENTITY_REFERENCE);
                 break;
             default :
-                throw new OMException();
+                throw new ParseException();
         }
         return token;
-    } catch (OMException e) {
+    } catch (ParseException e) {
         throw e;
+    } catch (OMException e) {
+        throw new ParseException(e);
     } catch (Exception e) {
-        throw new OMException(e);
+        throw new ParseException(e);
     }
   }
   



Mime
View raw message