Author: scottbw
Date: Wed Dec  1 12:14:18 2010
New Revision: 1040974

URL: http://svn.apache.org/viewvc?rev=1040974&view=rev
Log:
Catch and handle config.xml that is not well-formed using a 
BadManifestException rather than a raw stack trace

Modified:
    
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/WidgetManifestModel.java

Modified: 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/WidgetManifestModel.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/WidgetManifestModel.java?rev=1040974&r1=1040973&r2=1040974&view=diff
==============================================================================
--- 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/WidgetManifestModel.java
 (original)
+++ 
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/impl/WidgetManifestModel.java
 Wed Dec  1 12:14:18 2010
@@ -99,7 +99,12 @@ public class WidgetManifestModel impleme
                fFeaturesList = new ArrayList<IFeatureEntity>();
                fPreferencesList = new ArrayList<IPreferenceEntity>();
                SAXBuilder builder = new SAXBuilder();
-               Element root = builder.build(new 
StringReader(xmlText)).getRootElement();                               
+               Element root;
+               try {
+                       root = builder.build(new 
StringReader(xmlText)).getRootElement();
+               } catch (Exception e) {
+                       throw new BadManifestException("Config.xml is not 
well-formed XML");
+               }                               
                fromXML(root,locales);  
                
                // Add default icons


Reply via email to