diff --git a/src/scheduler/src/pool/VirtualMachinePoolXML.cc b/src/scheduler/src/pool/VirtualMachinePoolXML.cc index 102f1fe2c3..93667fd186 100644 --- a/src/scheduler/src/pool/VirtualMachinePoolXML.cc +++ b/src/scheduler/src/pool/VirtualMachinePoolXML.cc @@ -15,6 +15,7 @@ /* -------------------------------------------------------------------------- */ #include "VirtualMachinePoolXML.h" +#include int VirtualMachinePoolXML::set_up() { @@ -88,9 +89,19 @@ void VirtualMachinePoolXML::add_object(xmlNodePtr node) } else { - VirtualMachineXML* vm = new VirtualMachineXML( message ); + try + { + VirtualMachineXML* vm = new VirtualMachineXML( message ); - objects.insert( pair(vid, vm) ); + objects.insert( pair(vid, vm) ); + } + catch(runtime_error& re) + { + ostringstream oss_re; + + oss_re << re.what(); + NebulaLog::log("VM",Log::ERROR,oss_re); + } } } diff --git a/src/scheduler/src/xml/ObjectXML.cc b/src/scheduler/src/xml/ObjectXML.cc index 61b9882053..f67df49f91 100644 --- a/src/scheduler/src/xml/ObjectXML.cc +++ b/src/scheduler/src/xml/ObjectXML.cc @@ -202,7 +202,7 @@ void ObjectXML::xml_parse(const string &xml_doc) if (xml == 0) { - throw("Error parsing XML Document"); + throw runtime_error("Error parsing XML Document"); } ctx = xmlXPathNewContext(xml); @@ -210,7 +210,7 @@ void ObjectXML::xml_parse(const string &xml_doc) if (ctx == 0) { xmlFreeDoc(xml); - throw("Unable to create new XPath context"); + throw runtime_error("Unable to create new XPath context"); } }