Questions tagged [handleerror]
57 questions
111
votes
6 answers
ASP.NET MVC HandleError
How do I go about the [HandleError] filter in asp.net MVC Preview 5?
I set the customErrors in my Web.config file

Boris Callens
- 90,659
- 85
- 207
- 305
40
votes
6 answers
ASP.net MVC [HandleError] not catching exceptions
In two different application, one a custom the other the sample MVC application you get with a new VS2008 MVC project, [HandleError] is not catching exceptions.
In the sample application I have:
[HandleError]
public class HomeController :…
Eric
18
votes
4 answers
ASP.NET MVC user friendly 401 error
I have implemented errors handling in ASP.NET MVC site in a way like suggests this post.
With 404 errors all works fine. But how correctly show user friendly screen for a 401 error? They usually do not throw Exception that can be handled inside…

Roman
- 4,531
- 10
- 40
- 69
14
votes
7 answers
ASP.NET MVC HandleError not working (customErrors is set to "On")
I believe I have set up our MVC app to use [HandleError] properly. This is my controller:
[HandleError]
public class SupportController : BaseController {
public ActionResult Toss() {
throw new Exception("uh oh");
}
//…

swilliams
- 48,060
- 27
- 100
- 130
14
votes
1 answer
When was handleError removed from jQuery?
I'm revisiting some old code, and have found it doesn't work with jQuery 1.6 because it cannot find $.handleError(). A quick search of the jQuery code shows nothing, so I guess this function has been removed/replaced.
Does anyone know which…

shanethehat
- 15,460
- 11
- 57
- 87
14
votes
2 answers
How do I pass ViewData to a HandleError View?
In my Site.Master file, I have 3 simple ViewData parameters (the only 3 in my entire solution). These ViewData values are critical for every single page in my application. Since these values are used in my Site.Master, I created an abstract…

Luc
- 1,830
- 2
- 23
- 38
12
votes
6 answers
ASP.NET MVC - How to throw a 404 page similar to that on StackOverflow
I've currently got a BaseController class that inherits from System.Web.Mvc.Controller. On that class I have the HandleError Attribute that redirects users to the "500 - Oops, we screwed up" page. This is currently working as expected.
THIS…

Chase Florell
- 46,378
- 57
- 186
- 376
11
votes
6 answers
attribute does not seem to act at all
I am having problems using the [HandleError] attribute on my Controller Actions - it doesn't seem to work at all (i.e. it doesn't matter if the filter is there or not - I get the same results...). When an Exception is thrown, I get the standard…

Tomas Aschan
- 58,548
- 56
- 243
- 402
7
votes
2 answers
HandleError attribute doesn't have any effect
In my web.config I have included:
Now the yellow screen of death isn't shown anymore.
I thought I'd have to include the HandleError attribute to my controller methods or the class itself:
[HandleError]
public ActionResult…

mosquito87
- 4,270
- 11
- 46
- 77
5
votes
2 answers
ASP.Net MVC 3 - Order in HandleError attribute seems to work backwards?
Problem: When I use the Order property of the HandleError attribute, the highest order number gets applied first, as opposed to the lowest first.
Details
I want to set up my controller to handle exceptions in this way:
if the type of the exception…

Graham Clark
- 12,886
- 8
- 50
- 82
5
votes
1 answer
How can I make HandleErrorAttribute work with Ajax?
In my ASP.NET MVC 2 application I use HandleErrorAttribute to display a custom error page in case of unhandled exceptions, and it works perfectly unless the exception happens in an action called by Ajax.ActionLink. In this case nothing happens. Is…

SlimShaggy
- 2,917
- 4
- 22
- 23
5
votes
2 answers
HandleErrorAttribute derived class is not catching exceptions?
I have a ASP.NET MVC web app and I am trying to improve its error handling capabilities. I read up on the HandleErrorAttribute base class and wanted to use that with my controller classes. However, when I throw a test Exception from a method in…

Robert Oschler
- 14,153
- 18
- 94
- 227
3
votes
1 answer
MVC HandleError returns error 500 and view error page
I am using MVC 3 with VS2010 and trying to get [HandleError] working. I created a test in the controller to simulate a crash as follows:
[HandleError]
public ActionResult Crash()
{
throw new ApplicationException();
}
Also went into web.config…

bcuzz
- 147
- 3
- 8
3
votes
3 answers
Does HandleError work anymore in Asp.net MVC 4 with razor
I have the [HandleError] attribute set on my controller.
This is my action method:
public ActionResult ShowError()
{
throw new NullReferenceException();
return View();
}
This action method has a corresponding view.
I…

user20358
- 14,182
- 36
- 114
- 186
2
votes
1 answer
Is it possible to have ActionFilter exceptions handled via the [HandleError] mechanism?
I have a custom action filter (AuthenticateAttribute) in my ASP.NET MVC 3 application that ensures that users are logged in.
I want to raise exceptions in the OnActionExecuting method and would like those to be handled by the HandleError global…

dommer
- 19,610
- 14
- 75
- 137