]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#549] more accurate command errors
authorAndrei Pavel <andrei@isc.org>
Wed, 19 Apr 2023 20:34:13 +0000 (23:34 +0300)
committerAndrei Pavel <andrei@isc.org>
Wed, 19 Apr 2023 20:56:01 +0000 (23:56 +0300)
src/lib/cc/command_interpreter.cc

index ee72af75dbc4e7e0c52822e1be8cd5e2245d44c6..7b7c19e0369e1981a9b49aaad926d05612eb17e9 100644 (file)
@@ -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);