* Make sure RuntimeException can pass through in getHtmlDocument() so users

become aware of setup problems (missing xercesImpl.jar, xml-apis.jar).
This commit is contained in:
hns 2007-02-21 14:28:12 +00:00
parent 8a85d6d5cf
commit 7fd724eca3

View file

@ -25,6 +25,7 @@ import helma.util.MimePart;
import helma.util.XmlUtils; import helma.util.XmlUtils;
import org.mozilla.javascript.*; import org.mozilla.javascript.*;
import org.mozilla.javascript.serialize.*; import org.mozilla.javascript.serialize.*;
import org.xml.sax.SAXException;
import java.util.*; import java.util.*;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
@ -310,8 +311,8 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder {
mime.eTag = etag; mime.eTag = etag;
return Context.toObject(mime, this); return Context.toObject(mime, this);
} catch (Exception xcept) { } catch (Exception x) {
app.logEvent("Error getting URL "+location+": "+xcept); app.logError("Error getting URL "+location, x);
} }
return null; return null;
@ -330,8 +331,8 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder {
Object doc = XmlUtils.parseXml(p); Object doc = XmlUtils.parseXml(p);
return Context.toObject(doc, this); return Context.toObject(doc, this);
} catch (Exception noluck) { } catch (Exception x) {
app.logEvent("Error creating XML document: " + noluck); app.logError("Error creating XML document", x);
} }
return null; return null;
@ -350,8 +351,10 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder {
Object doc = helma.util.XmlUtils.parseHtml(p); Object doc = helma.util.XmlUtils.parseHtml(p);
return Context.toObject(doc, this); return Context.toObject(doc, this);
} catch (Exception noluck) { } catch (IOException iox) {
app.logEvent("Error creating HTML document: " + noluck); app.logError("Error creating HTML document", iox);
} catch (SAXException sx) {
app.logError("Error creating HTML document", sx);
} }
return null; return null;