You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
635 B
21 lines
635 B
using System.Linq;
|
|
using System.Web.Mvc;
|
|
using NLog;
|
|
using NzbDrone.Web.Models;
|
|
|
|
namespace NzbDrone.Web.Filters
|
|
{
|
|
public class JsonErrorFilter : FilterAttribute, IExceptionFilter
|
|
{
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
public void OnException(ExceptionContext filterContext)
|
|
{
|
|
filterContext.Result = JsonNotificationResult.Oops(filterContext.Exception.Message);
|
|
filterContext.ExceptionHandled = true;
|
|
logger.FatalException(filterContext.RequestContext.HttpContext.Request.RawUrl, filterContext.Exception);
|
|
}
|
|
|
|
|
|
}
|
|
} |