// Now clean up after ourselves.
ctrl->registerCommands();
+ // Add a config file.
+ ctrl->setConfigFile(string(TEST_DATA_BUILDDIR) + string("/config.json"));
+
// First, build the command:
string file = string(TEST_DATA_BUILDDIR) + string("/config-write.json");
string cmd_txt = "{ \"command\": \"config-write\" }";
try {
checkWriteConfigFile(filename);
} catch (const isc::Exception& ex) {
- return (createAnswer(CONTROL_RESULT_ERROR,
- string("not allowed to write config into ") +
- filename));
+ std::ostringstream msg;
+ msg << "not allowed to write config into " << filename
+ << ": " << ex.what();
+ return (createAnswer(CONTROL_RESULT_ERROR, msg.str()));
}
}
try {
checkWriteConfigFile(filename);
} catch (const isc::Exception& ex) {
- return (createAnswer(CONTROL_RESULT_ERROR,
- string("not allowed to write config into ") +
- filename));
+ std::ostringstream msg;
+ msg << "not allowed to write config into " << filename
+ << ": " << ex.what();
+ return (createAnswer(CONTROL_RESULT_ERROR, msg.str()));
}
}
try {
checkWriteConfigFile(filename);
} catch (const isc::Exception& ex) {
- return (createAnswer(CONTROL_RESULT_ERROR,
- std::string("not allowed to write config into ") +
- filename));
+ std::ostringstream msg;
+ msg << "not allowed to write config into " << filename
+ << ": " << ex.what();
+ return (createAnswer(CONTROL_RESULT_ERROR, msg.str()));
}
}
return;
}
isc_throw(isc::BadValue, "file " << file << " must be in the same "
- << "directory as the config file (" << config_file_ << "'");
+ << "directory as the config file (" << config_file_ << ")");
}
std::string