1
0
mirror of synced 2024-11-27 21:10:48 +01:00
TaikoSoundEditor/Utils/ExceptionGuard.cs

30 lines
590 B
C#
Raw Normal View History

2023-07-28 18:02:47 +02:00
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);
}
}
}