Add in verbose error message and telemetry for SetWindowsHookEx failure (#6454)

* Updated error message when SetWindowsHookEx fails to show correct error message

* Added telemetry for exception in SG, FZ and KBM

* Rename exception to error
This commit is contained in:
Arjun Balgovind
2020-09-09 14:27:40 -07:00
committed by GitHub
parent f61e9d389f
commit fb1888f01f
14 changed files with 90 additions and 45 deletions

View File

@@ -213,6 +213,19 @@ void Trace::FancyZones::EditorLaunched(int value) noexcept
TraceLoggingInt32(value, EditorLaunchValueKey));
}
// Log if an error occurs in FZ
void Trace::FancyZones::Error(const DWORD errorCode, std::wstring errorMessage, std::wstring methodName) noexcept
{
TraceLoggingWrite(
g_hProvider,
"FancyZones_Error",
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE),
TraceLoggingValue(methodName.c_str(), "MethodName"),
TraceLoggingValue(errorCode, "ErrorCode"),
TraceLoggingValue(errorMessage.c_str(), "ErrorMessage"));
}
void Trace::SettingsChanged(const Settings& settings) noexcept
{
const auto& editorHotkey = settings.editorHotkey;