using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Website.Controllers;

namespace Website
{
  public class CustomExceptionFilter : IExceptionFilter
  {
    public void OnException(ExceptionContext context)
    {
      if (context.Exception is MyCustomException)
      {
        context.Result = new RedirectResult("/links");
      }
    }
  }
}