Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions lib/perfdata/influxdbcommonwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,31 +493,8 @@ void InfluxdbCommonWriter::FlushWQ()
auto& response (parser.get());

if (response.result() != http::status::no_content) {
Log(LogWarning, GetReflectionType()->GetName())
<< "Unexpected response code: " << response.result();

auto& contentType (response[http::field::content_type]);
if (contentType != "application/json") {
Log(LogWarning, GetReflectionType()->GetName())
<< "Unexpected Content-Type: " << contentType;
return;
}

Dictionary::Ptr jsonResponse;
auto& body (response.body());

try {
jsonResponse = JsonDecode(body);
} catch (...) {
Log(LogWarning, GetReflectionType()->GetName())
<< "Unable to parse JSON response:\n" << body;
return;
}

String error = jsonResponse->Get("error");

Log(LogCritical, GetReflectionType()->GetName())
<< "InfluxDB error message:\n" << error;
<< "Unexpected response code: " << response.result() << ", InfluxDB error message:\n" << response.body();
}
}

Expand Down
Loading