To handle exceptions on Controller/Action level Exception Filters are used.
[TypeFilter(typeof(SampleExceptionFilter))] public class ExceptionController : Controller
Exception Filters are implemented using IExceptionFilter
with OnExcetion
method override to handle exceptions.
Exception Filters can be applied to Controller and Action level.
Further read: