Catch Pandora_Wmi::Pandora_Wmi_Exception exceptions. Fixes #89.
This commit is contained in:
parent
13894ba403
commit
e90fb3d8f7
|
@ -1139,12 +1139,15 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
module = new Pandora_Module_Freedisk_Percent (module_name,
|
||||
module_freedisk_percent);
|
||||
// Added a description with the memory free
|
||||
try {
|
||||
char buffer[100];
|
||||
unsigned long memory = Pandora_Wmi::getDiskFreeSpace(module_freedisk_percent);
|
||||
if (sprintf(buffer, "Free memory %s %dMB",
|
||||
module_freedisk_percent.c_str(), memory) > 0) {
|
||||
module->setDescription(buffer);
|
||||
}
|
||||
} catch (Pandora_Wmi::Pandora_Wmi_Exception e) {
|
||||
}
|
||||
} else if (module_freememory != "") {
|
||||
module = new Pandora_Module_Freememory (module_name);
|
||||
} else if (module_freememory_percent != "") {
|
||||
|
|
Loading…
Reference in New Issue