Log HTTP errors when verbose logging is enabled

This commit is contained in:
WarmUpTill 2025-04-24 19:05:15 +02:00 committed by WarmUpTill
parent 8326e72047
commit 470d5ba3d7

View File

@ -102,6 +102,11 @@ bool MacroActionHttp::PerformAction()
break;
}
if (VerboseLoggingEnabled() && !response) {
blog(LOG_INFO, "HTTP action error: %s",
httplib::to_string(response.error()).c_str());
}
SetTempVarValue("status",
response ? std::to_string(response->status) : "");
SetTempVarValue("body", response ? response->body : "");
@ -140,6 +145,7 @@ static std::string stringListToString(const StringList &list)
result += std::string(string) + ", ";
}
result.pop_back();
result.pop_back();
return result + "]";
}