From 7d0be591a006bfd5f44d1cf2da89a45a2d56e7dc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 13 Jun 2025 07:06:40 -0400 Subject: [PATCH] DOn't crash when we receive an unknown error --- src/zm_monitor_onvif.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/zm_monitor_onvif.cpp b/src/zm_monitor_onvif.cpp index e73183f0b..5a0f4f26c 100644 --- a/src/zm_monitor_onvif.cpp +++ b/src/zm_monitor_onvif.cpp @@ -105,7 +105,14 @@ void Monitor::ONVIF::start() { if (rc != SOAP_OK) { const char *detail = soap_fault_detail(soap); - Error("ONVIF Couldn't create subscription! %d, fault:%s, detail:%s", rc, soap_fault_string(soap), detail ? detail : "null"); + if (rc > 8) { + Error("ONVIF Couldn't create subscription at %s! %d, fault:%s, detail:%s", full_url.c_str(), + rc, soap_fault_string(soap), detail ? detail : "null"); + } else { + Error("ONVIF Couldn't create subscription at %s! %d %s, fault:%s, detail:%s", full_url.c_str(), + rc, SOAP_STRINGS[rc].c_str(), + soap_fault_string(soap), detail ? detail : "null"); + } std::stringstream ss; std::ostream *old_stream = soap->os;