using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using Rhea.Common;
|
|
namespace Tiger.IBusiness
|
{
|
public static class ResultExtension
|
{
|
public static Result<T> CatchExceptionWithLog<T>(this Result<T> result, Exception ex, Locale localeMsg, T data)
|
{
|
result.Data = data;
|
return CatchExceptionWithLog<T>(result, ex, localeMsg);
|
}
|
|
public static Result<T> CatchExceptionWithLog<T>(this Result<T> result, Exception ex, Locale localeMsg)
|
{
|
result.CatchExceptionWithLog(ex, localeMsg);
|
Logger.Default.Fatal(ex, localeMsg.Default());
|
return result;
|
}
|
|
public static Result<T> CatchExceptionWithLog<T>(this Result<T> result, Exception ex, string msg, T data)
|
{
|
result.Data = data;
|
return CatchExceptionWithLog<T>(result, ex, msg);
|
}
|
|
public static Result<T> CatchExceptionWithLog<T>(this Result<T> result, Exception ex, string msg = null)
|
{
|
result.CatchExceptionWithLog(ex, msg);
|
Logger.Default.Fatal(ex, msg);
|
return result;
|
}
|
|
public static Result CatchExceptionWithLog(this Result result, Exception ex, Locale localeMsg, object data)
|
{
|
result.Data = data;
|
return CatchExceptionWithLog(result, ex, localeMsg);
|
}
|
|
public static Result CatchExceptionWithLog(this Result result, Exception ex, Locale localeMsg)
|
{
|
result.CatchExceptionWithLog(ex, localeMsg);
|
Logger.Default.Fatal(ex, localeMsg.Default());
|
return result;
|
}
|
|
public static Result CatchExceptionWithLog(this Result result, Exception ex, string msg, object data)
|
{
|
result.Data = data;
|
return CatchExceptionWithLog(result, ex, msg);
|
}
|
|
public static Result CatchExceptionWithLog(this Result result, Exception ex, string msg = null)
|
{
|
result.CatchExceptionWithLog(ex, msg);
|
Logger.Default.Fatal(ex, msg);
|
return result;
|
}
|
}
|
}
|