summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2023-04-19 22:34:13 +0200
committerAndrei Pavel <andrei@isc.org>2023-04-19 22:56:01 +0200
commit712c179b6a2036e2a188de09b6067f686a17754a (patch)
treec23925233b57ca7d8d045a0a48c8c1edbdcbf058 /src/lib
parent[#549] more accurate command errors (diff)
downloadkea-712c179b6a2036e2a188de09b6067f686a17754a.tar.xz
kea-712c179b6a2036e2a188de09b6067f686a17754a.zip
[#549] more accurate command errors
Diffstat (limited to '')
-rw-r--r--src/lib/cc/command_interpreter.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/cc/command_interpreter.cc b/src/lib/cc/command_interpreter.cc
index ee72af75db..7b7c19e036 100644
--- a/src/lib/cc/command_interpreter.cc
+++ b/src/lib/cc/command_interpreter.cc
@@ -213,20 +213,22 @@ parseCommandWithArgs(ConstElementPtr& arg, ConstElementPtr command) {
// This function requires arguments within the command.
if (!arg) {
- isc_throw(CtrlChannelError, "invalid command: no arguments specified for the '"
- << command_name << "' command");
+ isc_throw(CtrlChannelError,
+ "invalid command '" << command_name << "': no arguments specified");
}
// Arguments must be a map.
if (arg->getType() != Element::map) {
- isc_throw(CtrlChannelError, "invalid command: expected '"
+ isc_throw(CtrlChannelError,
+ "invalid command '" << command_name << "': expected "
<< CONTROL_ARGUMENTS << "' to be a map, got "
<< Element::typeToName(arg->getType()) << " instead");
}
// At least one argument is required.
if (arg->size() == 0) {
- isc_throw(CtrlChannelError, "invalid command: '" << CONTROL_ARGUMENTS << "' is empty");
+ isc_throw(CtrlChannelError, "invalid command '" << command_name << "': '"
+ << CONTROL_ARGUMENTS << "' is empty");
}
return (command_name);