DOn't crash when we receive an unknown error

This commit is contained in:
Isaac Connor
2025-06-13 07:06:40 -04:00
parent e6d11b5d88
commit 7d0be591a0

View File

@@ -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;