Tweaks to sentry integration
Report menu item activation, and define a RAII helper for setting the XML error reporting state.
This commit is contained in:
parent
c85916d88d
commit
a0ff4adbc6
3 changed files with 30 additions and 10 deletions
|
@ -8,9 +8,10 @@
|
|||
#include <simgear/structure/SGBinding.hxx>
|
||||
#include <simgear/props/props_io.hxx>
|
||||
|
||||
#include <Main/fg_props.hxx>
|
||||
#include <Main/globals.hxx>
|
||||
#include <Main/locale.hxx>
|
||||
#include <Main/fg_props.hxx>
|
||||
#include <Main/sentryIntegration.hxx>
|
||||
|
||||
#include "new_gui.hxx"
|
||||
#include "FGPUIMenuBar.hxx"
|
||||
|
@ -161,6 +162,8 @@ FGPUIMenuBar::fireItem (puObject * item)
|
|||
vector<SGBinding *> &bindings = _bindings[name];
|
||||
int nBindings = bindings.size();
|
||||
|
||||
flightgear::addSentryBreadcrumb("fire menu item:" + string{item->getLabel()}, "info");
|
||||
|
||||
for (int i = 0; i < nBindings; i++)
|
||||
bindings[i]->fire();
|
||||
}
|
||||
|
|
|
@ -69,8 +69,8 @@ auto XML_messageWhitelist = {
|
|||
"no element found",
|
||||
"Root element name is",
|
||||
"XML or text declaration not at start of entity",
|
||||
"Failed to open file"
|
||||
};
|
||||
"Failed to open file",
|
||||
"unclosed token"};
|
||||
|
||||
auto exception_messageWhitelist = {
|
||||
"position is invalid, NaNs", ///< avoid spam when NaNs occur
|
||||
|
@ -552,4 +552,14 @@ void addSentryTag(const std::string& tag, const std::string& value)
|
|||
addSentryTag(tag.c_str(), value.c_str());
|
||||
}
|
||||
|
||||
SentryXMLErrorSupression::SentryXMLErrorSupression()
|
||||
{
|
||||
sentryThreadReportXMLErrors(false);
|
||||
}
|
||||
|
||||
SentryXMLErrorSupression::~SentryXMLErrorSupression()
|
||||
{
|
||||
sentryThreadReportXMLErrors(true);
|
||||
}
|
||||
|
||||
} // of namespace flightgear
|
||||
|
|
|
@ -56,5 +56,12 @@ void sentryReportFatalError(const std::string& msg, const std::string& more = {}
|
|||
*/
|
||||
void sentryThreadReportXMLErrors(bool report);
|
||||
|
||||
class SentryXMLErrorSupression
|
||||
{
|
||||
public:
|
||||
SentryXMLErrorSupression();
|
||||
~SentryXMLErrorSupression();
|
||||
};
|
||||
|
||||
} // of namespace flightgear
|
||||
|
||||
|
|
Loading…
Reference in a new issue