1
0
Fork 0

Sentry: improve how we report extra data

This commit is contained in:
Automatic Release Builder 2020-11-29 20:16:26 +00:00 committed by James Turner
parent d9e535913e
commit 5ad9eafca7

View file

@ -64,8 +64,8 @@ auto OSG_messageWhitelist = {
auto XML_messageWhitelist = {
"Cannot open file",
"not well-formed (invalid token)",
"mismatched tag (from 'SimGear XML Parser')",
"syntax error (from 'SimGear XML Parser')",
"mismatched tag",
"syntax error",
"Root element name is"
};
@ -106,14 +106,17 @@ void sentryTraceSimgearThrow(const std::string& msg, const std::string& origin,
sentry_value_set_by_key(exc, "type", sentry_value_new_string("Exception"));
string message = msg;
sentry_value_t info = sentry_value_new_object();
if (!origin.empty()) {
message += " (from '" + origin + "')";
sentry_value_set_by_key(info, "origin", sentry_value_new_string(origin.c_str()));
}
if (loc.isValid()) {
message += " at " + loc.asString();
const auto ls = loc.asString();
sentry_value_set_by_key(info, "location", sentry_value_new_string(ls.c_str()));
}
sentry_set_context("what", info);
sentry_value_set_by_key(exc, "value", sentry_value_new_string(message.c_str()));
sentry_value_t event = sentry_value_new_event();