From c5afc2e4e4d52aa85c194aafbcbf3f1866e99e9f Mon Sep 17 00:00:00 2001 From: kwy404 Date: Thu, 24 Sep 2026 07:10:43 -0300 Subject: [PATCH 1/3] Log rejected connection PATCH for a resource that is not found --- Development/nmos/connection_api.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Development/nmos/connection_api.cpp b/Development/nmos/connection_api.cpp index b0acc28c0..4f4c50712 100644 --- a/Development/nmos/connection_api.cpp +++ b/Development/nmos/connection_api.cpp @@ -670,6 +670,8 @@ namespace nmos } else { + slog::log(gate, SLOG_FLF) << "Rejecting PATCH request for " << id_type << " which was not found"; + return details::make_connection_resource_patch_error_response(status_codes::NotFound); } } From b1207224ebb7376f857003952d1c30858570f7c6 Mon Sep 17 00:00:00 2001 From: kwy404 Date: Thu, 1 Oct 2026 13:20:35 -0300 Subject: [PATCH 2/3] Log a not found item at more_info in the bulk handler instead handle_connection_resource_patch is shared with PATCH /single, which already logs "Route not found", so log the not found case only in the /bulk handler, where the outer status stays 200 OK, and at more_info like other ordinary 404 cases. --- Development/nmos/connection_api.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Development/nmos/connection_api.cpp b/Development/nmos/connection_api.cpp index 4f4c50712..201be40ad 100644 --- a/Development/nmos/connection_api.cpp +++ b/Development/nmos/connection_api.cpp @@ -670,8 +670,6 @@ namespace nmos } else { - slog::log(gate, SLOG_FLF) << "Rejecting PATCH request for " << id_type << " which was not found"; - return details::make_connection_resource_patch_error_response(status_codes::NotFound); } } @@ -1101,6 +1099,11 @@ namespace nmos result = handle_connection_resource_exception({ id, type }); } + if (status_codes::NotFound == result.first) + { + slog::log(gate, SLOG_FLF) << "Resource not found for " << std::make_pair(id, type) << " in bulk request"; + } + results.push_back(result); } From b381d3a34d435f0211a6b2e8877ab3a4f34c080c Mon Sep 17 00:00:00 2001 From: kwy404 Date: Fri, 2 Oct 2026 16:29:04 -0300 Subject: [PATCH 3/3] Log Conflict as well as NotFound inside the bulk try block Move the more_info log into the try block right after handle_connection_resource_patch, since only that call returns these codes, and also log a Conflict result. --- Development/nmos/connection_api.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Development/nmos/connection_api.cpp b/Development/nmos/connection_api.cpp index 201be40ad..087727e8d 100644 --- a/Development/nmos/connection_api.cpp +++ b/Development/nmos/connection_api.cpp @@ -1093,17 +1093,21 @@ namespace nmos try { result = details::handle_connection_resource_patch(model, lock, version, { id, type }, patch[nmos::fields::params], request_time, parse_transport_file, validate_merged, gate); + + if (status_codes::NotFound == result.first) + { + slog::log(gate, SLOG_FLF) << "Resource not found for " << std::make_pair(id, type) << " in bulk request"; + } + else if (status_codes::Conflict == result.first) + { + slog::log(gate, SLOG_FLF) << "Resource conflict for " << std::make_pair(id, type) << " in bulk request"; + } } catch (...) { result = handle_connection_resource_exception({ id, type }); } - if (status_codes::NotFound == result.first) - { - slog::log(gate, SLOG_FLF) << "Resource not found for " << std::make_pair(id, type) << " in bulk request"; - } - results.push_back(result); }