using System; using System.Net.Http; using System.Web.Http.Filters; using iiie.Logs.DataAccess; using iiie.Logs.DBO; namespace iiie.WebApiUtils.BusinessManager.Attributes { [AttributeUsage(AttributeTargets.Method)] public class ExceptionLoggerAttribute : ExceptionFilterAttribute { public override void OnException(HttpActionExecutedContext context) { var result = Logger.Error(ResultStatus.InternalError, context.Exception); context.Response = context.Request.CreateErrorResponse(BMRHandler.ResultStatusToHttp(result.Status), BMRHandler.OpResultToString(result)); } } }