From edbd8688fbca469663ba8c4b10d0bfc3ab790a36 Mon Sep 17 00:00:00 2001 From: Mattia Codato Date: Wed, 1 Jul 2020 08:19:35 +0200 Subject: [PATCH] Update status code --- lib/icinga/apiactions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index 67ae389cd..432fae212 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -626,13 +626,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, "Can't find a valid " + command_type + " for '" + resolved_command + "'."); + return ApiActions::CreateResult(404, "Can't find a valid " + command_type + " for '" + resolved_command + "'."); } else if (command_type == "EventCommand") { if (!EventCommand::GetByName(resolved_command)) - return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'."); + return ApiActions::CreateResult(404, "Can't find a valid " + command_type + " for '" + resolved_command + "'."); } else if (command_type == "NotificationCommand") { if (!NotificationCommand::GetByName(resolved_command)) - return ApiActions::CreateResult(400, "Can't find a valid " + command_type + " for '" + resolved_command + "'."); + return ApiActions::CreateResult(404, "Can't find a valid " + command_type + " for '" + resolved_command + "'."); } /* Get TTL param */