Fix: Crash when state file is invalid.

Fixes #5361
This commit is contained in:
Gunnar Beutner 2014-01-28 14:32:56 +01:00
parent 08303f9aca
commit f9e8e204f9
1 changed files with 6 additions and 1 deletions

View File

@ -26,6 +26,7 @@
#include "base/logger_fwd.h" #include "base/logger_fwd.h"
#include "base/debug.h" #include "base/debug.h"
#include "base/workqueue.h" #include "base/workqueue.h"
#include "base/exception.h"
#include <sstream> #include <sstream>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
@ -326,7 +327,11 @@ bool ConfigItem::ActivateItems(bool validateOnly)
return true; return true;
/* restore the previous program state */ /* restore the previous program state */
DynamicObject::RestoreObjects(Application::GetStatePath()); try {
DynamicObject::RestoreObjects(Application::GetStatePath());
} catch (const std::exception& ex) {
Log(LogCritical, "config", "Failed to restore state file: " + DiagnosticInformation(ex));
}
Log(LogInformation, "config", "Triggering Start signal for config items"); Log(LogInformation, "config", "Triggering Start signal for config items");