Simplify "Backend heartbeat response" error (closes #97)

This commit is contained in:
Lion Kortlepel 2022-03-25 12:55:35 +01:00
parent a97763a94f
commit 71c2d4b859
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B
3 changed files with 8 additions and 3 deletions

2
deps/commandline vendored

@ -1 +1 @@
Subproject commit 71240f634b211d830679e7d2841b897c7c30dad9
Subproject commit 01434c11aaf82d37a126dc70f5aa02cc523dbbb4

View File

@ -12,6 +12,7 @@ extern TSentry Sentry;
#include <mutex>
#include <sstream>
#include <zlib.h>
#include <filesystem>
#include "Compat.h"

View File

@ -62,8 +62,8 @@ void THeartbeatThread::operator()() {
beammp_trace(T);
Doc.Parse(T.data(), T.size());
if (Doc.HasParseError() || !Doc.IsObject()) {
beammp_error("Backend response failed to parse as valid json");
beammp_debug("Response was: `" + T + "`");
beammp_debug("Failed to contact backend at " + Url + " (this is not an error).");
beammp_trace("Response was: " + T);
Sentry.SetContext("JSON Response", { { "reponse", T } });
SentryReportError(Url + Target, ResponseCode);
} else if (ResponseCode != 200) {
@ -105,6 +105,10 @@ void THeartbeatThread::operator()() {
beammp_error("Missing/invalid json members in backend response");
Sentry.LogError("Missing/invalid json members in backend response", __FILE__, std::to_string(__LINE__));
}
} else {
if (!Application::Settings.Private) {
beammp_warn("Backend failed to respond to a heartbeat. Your server may temporarily disappear from the server list. This is not an error, and will likely resolve itself soon. Direct connect will still work.");
}
}
if (Ok && !isAuth) {