Also worthy of discussion: Parameter Binding errors are not caught by the ExceptionFilters. If a parameter does not bind correctly there is no way to catch the error with the HandleError attribute on a action or controller. A review of ControllerActionInvoker shows the code as:
public virtual bool InvokeAction(ControllerContext controllerContext, string actionName) {
...
IDictionary<string, object> parameters = GetParameterValues(methodInfo);
FilterInfo filterInfo = GetFiltersForActionMethod(methodInfo);
try {
//call action
}
catch (Exception ex) {
// something blew up, so execute the exception filters
ExceptionContext exceptionContext = InvokeExceptionFilters(ex, filterInfo.ExceptionFilters);
...
}
Instead, I think it would be better as:
public virtual bool InvokeAction(ControllerContext controllerContext, string actionName) {
...
FilterInfo filterInfo = GetFiltersForActionMethod(methodInfo);
try {
IDictionary<string, object> parameters = GetParameterValues(methodInfo);
//call action
}
catch (Exception ex) {
// something blew up, so execute the exception filters
ExceptionContext exceptionContext = InvokeExceptionFilters(ex, filterInfo.ExceptionFilters);
...
}
That way you could handle exceptions in parsing action parameters.