mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-03 05:26:05 +02:00
Add try-catch to desktop notification (#839)
This commit is contained in:
@@ -241,6 +241,8 @@ namespace VRCX
|
|||||||
/// <param name="Text">The optional text to display in the notification.</param>
|
/// <param name="Text">The optional text to display in the notification.</param>
|
||||||
/// <param name="Image">The optional image to display in the notification.</param>
|
/// <param name="Image">The optional image to display in the notification.</param>
|
||||||
public void DesktopNotification(string BoldText, string Text = "", string Image = "")
|
public void DesktopNotification(string BoldText, string Text = "", string Image = "")
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
ToastContentBuilder builder = new ToastContentBuilder();
|
ToastContentBuilder builder = new ToastContentBuilder();
|
||||||
|
|
||||||
@@ -255,6 +257,15 @@ namespace VRCX
|
|||||||
|
|
||||||
builder.Show();
|
builder.Show();
|
||||||
}
|
}
|
||||||
|
catch (System.AccessViolationException ex)
|
||||||
|
{
|
||||||
|
logger.Warn(ex, "Unable to send desktop notification");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
logger.Error(ex, "Unknown error when sending desktop notification");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Restarts the VRCX application for an update by launching a new process with the "/Upgrade" argument and exiting the current process.
|
/// Restarts the VRCX application for an update by launching a new process with the "/Upgrade" argument and exiting the current process.
|
||||||
|
|||||||
Reference in New Issue
Block a user