cobra to sentry / more error handling

This commit is contained in:
Benjamin Sergeant
2019-06-05 19:37:51 -07:00
parent 89909c15bc
commit f4f3eed78d
3 changed files with 9 additions and 13 deletions

View File

@ -47,12 +47,12 @@ namespace ix
std::condition_variable progressCondition;
std::queue<Json::Value> queue;
SentryClient sentryClient(dsn);
auto sentrySender = [&condition, &progressCondition, &conditionVariableMutex,
&queue, verbose, &errorSending, &sentCount,
&stop, &sentryClient]
&stop, &dsn]
{
SentryClient sentryClient(dsn);
while (true)
{
Json::Value msg;
@ -70,8 +70,8 @@ namespace ix
if (response->statusCode != 200)
{
spdlog::error("Error sending data to sentry: {}", response->statusCode);
spdlog::error("Body: {}", ret.second);
spdlog::error("Response: {}", response->payload);
spdlog::error("Log: {}", ret.second);
errorSending = true;
}
else
@ -192,6 +192,6 @@ namespace ix
pool[i].join();
}
return 0;
return (strict && errorSending) ? 1 : 0;
}
}