mgmt: Fixing regression introduced by change in the library
After more consistent usage of exceptions (most of the exceptions now
derived from Tlv::Error), `ndn::io::load` would not normally throw an
exception.
Change-Id: Ifd32653e681b94829007db3750e04754e9976fbd
diff --git a/daemon/mgmt/command-validator.cpp b/daemon/mgmt/command-validator.cpp
index ac08228..ad3443c 100644
--- a/daemon/mgmt/command-validator.cpp
+++ b/daemon/mgmt/command-validator.cpp
@@ -119,15 +119,19 @@
}
catch(const std::runtime_error& error)
{
- std::string msg = "Malformed certificate file " + certfilePath.native();
- if (!isDryRun)
- {
- throw ConfigFile::Error(msg);
- }
- aggregateErrors(dryRunErrors, msg);
- continue;
+ // do nothing
}
+ if (!static_cast<bool>(id)) {
+ std::string msg = "Malformed certificate file " + certfilePath.native();
+ if (!isDryRun)
+ {
+ throw ConfigFile::Error(msg);
+ }
+ aggregateErrors(dryRunErrors, msg);
+ continue;
+ }
+
in.close();
const ConfigSection* privileges = 0;