1
0
mirror of synced 2024-11-30 14:14:29 +01:00
TaikoSoundEditor/Utils/ExceptionGuard.cs
2023-07-28 19:02:47 +03:00

30 lines
590 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TaikoSoundEditor.Utils
{
internal static class ExceptionGuard
{
public static void Run(Action action)
{
try
{
action();
}
catch (Exception ex)
{
Error(ex);
}
}
public static void Error(Exception e)
{
MessageBox.Show(e.Message, "An error occured");
Logger.Error(e);
}
}
}