mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-05-21 21:03:44 +12:00
Add a bit of exception handling to headpats/hugs buttons
This commit is contained in:
parent
a6321a9ecc
commit
8160521d10
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
@ -50,12 +51,32 @@ namespace VRCMelonAssistant.Pages
|
||||||
|
|
||||||
private async Task HeadPat()
|
private async Task HeadPat()
|
||||||
{
|
{
|
||||||
PatImage.Load(await WeebCDN("pats"));
|
try
|
||||||
|
{
|
||||||
|
PatImage.Load(await WeebCDN("pats"));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
Utils.ShowErrorMessageBox("Oops! Can't get headpats right now!", ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Hug()
|
private async Task Hug()
|
||||||
{
|
{
|
||||||
HugImage.Load(await WeebCDN("hugs"));
|
try
|
||||||
|
{
|
||||||
|
HugImage.Load(await WeebCDN("hugs"));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
Utils.ShowErrorMessageBox("Oops! Can't get hugs right now!", ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue