mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[3501] Corrected error messages reported when configuration error occurs.
Also, removed multiple references to DHCP4_CONFIG_LOAD_FAIL from the DHCPv4 server and DHCP6_CONFIG_LOAD_FAIL from the DHCPv6 server.
This commit is contained in:
@@ -594,8 +594,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
|
||||
} catch (const isc::Exception& ex) {
|
||||
LOG_ERROR(dhcp4_logger, DHCP4_PARSER_FAIL)
|
||||
.arg(config_pair.first).arg(ex.what());
|
||||
answer = isc::config::createAnswer(1,
|
||||
string("Configuration parsing failed: ") + ex.what());
|
||||
answer = isc::config::createAnswer(1, ex.what());
|
||||
|
||||
// An error occured, so make sure that we restore original data.
|
||||
rollback = true;
|
||||
@@ -603,8 +602,8 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
|
||||
} catch (...) {
|
||||
// For things like bad_cast in boost::lexical_cast
|
||||
LOG_ERROR(dhcp4_logger, DHCP4_PARSER_EXCEPTION).arg(config_pair.first);
|
||||
answer = isc::config::createAnswer(1,
|
||||
string("Configuration parsing failed"));
|
||||
answer = isc::config::createAnswer(1, "undefined configuration"
|
||||
" processing error");
|
||||
|
||||
// An error occured, so make sure that we restore original data.
|
||||
rollback = true;
|
||||
@@ -636,14 +635,13 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
|
||||
}
|
||||
catch (const isc::Exception& ex) {
|
||||
LOG_ERROR(dhcp4_logger, DHCP4_PARSER_COMMIT_FAIL).arg(ex.what());
|
||||
answer = isc::config::createAnswer(2,
|
||||
string("Configuration commit failed: ") + ex.what());
|
||||
answer = isc::config::createAnswer(2, ex.what());
|
||||
rollback = true;
|
||||
} catch (...) {
|
||||
// For things like bad_cast in boost::lexical_cast
|
||||
LOG_ERROR(dhcp4_logger, DHCP4_PARSER_COMMIT_EXCEPTION);
|
||||
answer = isc::config::createAnswer(2,
|
||||
string("Configuration commit failed"));
|
||||
answer = isc::config::createAnswer(2, "undefined configuration"
|
||||
" parsing error");
|
||||
rollback = true;
|
||||
}
|
||||
}
|
||||
@@ -659,7 +657,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
|
||||
getConfigSummary(Configuration::CFGSEL_ALL4));
|
||||
|
||||
// Everything was fine. Configuration is successful.
|
||||
answer = isc::config::createAnswer(0, "Configuration committed.");
|
||||
answer = isc::config::createAnswer(0, "Configuration successful.");
|
||||
return (answer);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user