[PreviewHandlers]Ignore telemetry exceptions (#28612)

This commit is contained in:
Jaime Bernardo
2023-09-19 15:41:17 +01:00
committed by GitHub
parent b471c98f7e
commit e09839dd6e
4 changed files with 65 additions and 9 deletions

View File

@@ -200,11 +200,23 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
}
});
PowerToysTelemetry.Log.WriteEvent(new MarkdownFilePreviewed());
try
{
PowerToysTelemetry.Log.WriteEvent(new MarkdownFilePreviewed());
}
catch
{ // Should not crash if sending telemetry is failing. Ignore the exception.
}
}
catch (Exception ex)
{
PowerToysTelemetry.Log.WriteEvent(new MarkdownFilePreviewError { Message = ex.Message });
try
{
PowerToysTelemetry.Log.WriteEvent(new MarkdownFilePreviewError { Message = ex.Message });
}
catch
{ // Should not crash if sending telemetry is failing. Ignore the exception.
}
Controls.Clear();
_infoBarDisplayed = true;