17 lines
372 B
C#
17 lines
372 B
C#
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");
|
|
}
|
|
}
|
|
}
|
|
} |