Fix response strings

This commit is contained in:
Mattia Codato 2020-06-30 15:48:29 +02:00
parent 5c06256ac5
commit 8f3617d074
1 changed files with 4 additions and 4 deletions

View File

@ -558,7 +558,7 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object,
{
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
if (!checkable)
return ApiActions::CreateResult(404, "Can't schedule a command execution for non-existent object.");
return ApiActions::CreateResult(404, "Can't start a command execution for a non-existent object.");
ObjectLock oLock (checkable);
@ -630,13 +630,13 @@ Dictionary::Ptr ApiActions::ExecuteCommand(const ConfigObject::Ptr& object,
/* Check if resolved_command exists and it is of type command_type */
if (command_type == "CheckCommand") {
if (!CheckCommand::GetByName(resolved_command))
return ApiActions::CreateResult(400, "Command '" + resolved_command + "' is not of type '" + command_type + "'.");
return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
} else if (command_type == "EventCommand") {
if (!EventCommand::GetByName(resolved_command))
return ApiActions::CreateResult(400, "Command '" + resolved_command + "' is not of type '" + command_type + "'.");
return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
} else if (command_type == "NotificationCommand") {
if (!NotificationCommand::GetByName(resolved_command))
return ApiActions::CreateResult(400, "Command '" + resolved_command + "' is not of type '" + command_type + "'.");
return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'.");
}
/* Get TTL param */