Guard marshalling with exception handler.
authorScott Cantor <cantor.2@osu.edu>
Thu, 12 Feb 2015 19:29:44 +0000 (19:29 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 12 Feb 2015 19:29:44 +0000 (19:29 +0000)
xmltooling/util/XMLHelper.cpp

index 88dccbe..a270de4 100644 (file)
@@ -452,5 +452,11 @@ ostream& xmltooling::operator<<(ostream& ostr, const DOMNode& node)
 
 ostream& xmltooling::operator<<(ostream& ostr, const XMLObject& obj)
 {
-    return ostr << *(obj.marshall());
+    try {
+        return ostr << *(obj.marshall());
+    }
+    catch (DOMException& ex) {
+        auto_ptr_char msg(ex.getMessage());
+        throw XMLParserException(msg.get());
+    }
 }