mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-04 00:36:14 +00:00
Sentry: add debug, remove wrong exception to sentry logging
This commit is contained in:
parent
ff3cbebac0
commit
b33b396089
@ -40,15 +40,16 @@ void THeartbeatThread::operator()() {
|
|||||||
T = Http::POST(Application::GetBackendHostname(), Target, {}, Body, false, &ResponseCode);
|
T = Http::POST(Application::GetBackendHostname(), Target, {}, Body, false, &ResponseCode);
|
||||||
|
|
||||||
if (T.substr(0, 2) != "20" || ResponseCode != 200) {
|
if (T.substr(0, 2) != "20" || ResponseCode != 200) {
|
||||||
|
#if DEBUG
|
||||||
|
debug("got " + T + " from backend");
|
||||||
|
#endif // DEBUG
|
||||||
auto SentryReportError = [&](const std::string& transaction, int status) {
|
auto SentryReportError = [&](const std::string& transaction, int status) {
|
||||||
if (T != "YOU_SHALL_NOT_PASS") {
|
|
||||||
auto Lock = Sentry.CreateExclusiveContext();
|
auto Lock = Sentry.CreateExclusiveContext();
|
||||||
Sentry.SetContext("heartbeat",
|
Sentry.SetContext("heartbeat",
|
||||||
{ { "response-body", T },
|
{ { "response-body", T },
|
||||||
{ "request-body", Body } });
|
{ "request-body", Body } });
|
||||||
Sentry.SetTransaction(transaction);
|
Sentry.SetTransaction(transaction);
|
||||||
Sentry.Log(SentryLevel::Error, "default", "unexpected backend response (" + std::to_string(status) + ")");
|
Sentry.Log(SentryLevel::Error, "default", "unexpected backend response (" + std::to_string(status) + ")");
|
||||||
}
|
|
||||||
};
|
};
|
||||||
SentryReportError(Application::GetBackendHostname() + Target, ResponseCode);
|
SentryReportError(Application::GetBackendHostname() + Target, ResponseCode);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user