Manage NotFoundException for different configuration shema.

Signed-off-by: zosrothko <zosrothko@orange.fr>
This commit is contained in:
zosrothko 2017-11-11 10:40:39 +01:00
parent b45b4b8899
commit 83bd74e881

View File

@ -227,10 +227,21 @@ protected:
else
platformComp += ".unix";
std::string exec = config().getString(platformComp + ".exec", config().getString(comp + ".exec"));
std::string opts = config().getString(platformComp + ".options", config().getString(comp + ".options"));
std::string path = config().getString(platformComp + ".path", config().getString(comp + ".path", ""));
bool usePipe = config().getBool(platformComp + ".usePipe", config().getBool(comp + ".usePipe", false));
std::string exec;
std::string opts;
std::string path;
bool usePipe;
try {
exec = config().getString(comp + ".exec");
opts = config().getString(comp + ".options");
path = config().getString(comp + ".path", "");
usePipe = config().getBool(comp + ".usePipe", false);
} catch (Poco::NotFoundException&) {
exec = config().getString(platformComp + ".exec");
opts = config().getString(platformComp + ".options");
path = config().getString(platformComp + ".path", "");
usePipe = config().getBool(platformComp + ".usePipe", false);
}
std::string popts;
for (std::string::const_iterator it = opts.begin(); it != opts.end(); ++it)