namespace System
{
public static class ActionUtils
{
///
/// Action的安全回调
///
///
public static void SafeInvoke(this Action action)
{
try
{
action?.Invoke();
}
catch (Exception ex)
{
XGame.Log.Exception(ex);
}
}
///
/// Action的安全回调
///
///
///
///
public static void SafeInvoke(this Action action, T obj)
{
try
{
action?.Invoke(obj);
}
catch (Exception ex)
{
XGame.Log.Exception(ex);
}
}
}
}