From f8ab7669388bf4a0985065681831fbf650c1f8ef Mon Sep 17 00:00:00 2001 From: Taclane Date: Sun, 30 Nov 2025 14:47:54 -0500 Subject: [PATCH] do not retry config errors --- plugins/openmhz_uploader/openmhz_uploader.cc | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/openmhz_uploader/openmhz_uploader.cc b/plugins/openmhz_uploader/openmhz_uploader.cc index 46b983c7..245049f4 100644 --- a/plugins/openmhz_uploader/openmhz_uploader.cc +++ b/plugins/openmhz_uploader/openmhz_uploader.cc @@ -305,6 +305,27 @@ class Openmhz_Uploader : public Plugin_Api { } } std::string loghdr = log_header(call_info.short_name,call_info.call_num,call_info.talkgroup_display,call_info.freq); + + // Configuration errors - skip the retry queue + static const struct { const char* match; const char* message; bool is_error; } config_errors[] = { + {"API Keys do not match", "Error: Invalid API Key", true}, + {"ShortName does not exist", "Error: Invalid System Name", true}, + {"Error, invalid filename", "Error: Invalid Filename", true}, + {"Talkgroup does not exist", "Skipped: System Ignoring Unknown Talkgroups", false} + }; + + for (const auto& error : config_errors) { + if (response_buffer.find(error.match) != std::string::npos) { + if (error.is_error) { + BOOST_LOG_TRIVIAL(error) << loghdr << "OpenMHz Upload " << error.message; + } else { + BOOST_LOG_TRIVIAL(info) << loghdr << "OpenMHz Upload " << error.message; + } + return 0; + } + } + + // Default error - add to the retry queue BOOST_LOG_TRIVIAL(error) << loghdr << "OpenMHz Upload Error: " << response_buffer; return 1; }