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");
}
// snip
}
And I have set my customErrors
tag in web.config
to "On":
<customErrors mode="On"></customErrors>
However, I am still getting the Yellow Screen of Death on Exceptions. Setting a breakpoint in my Toss()
action shows that HttpContext.IsCustomErrorEnabled
is set to true.
We are not doing anything with the View Engine, and the BaseController
doesn't mess with anything either (and other Controllers that do not extend it have the same issue).
I am developing on Windows XP, and have the same issue when the app is deployed to a server 2003 box (IIS 6).
I do not think there is an Exception on the error.aspx
page:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="errorContent" ContentPlaceHolderID="MainContent" runat="server">
<h2>
Sorry, an error occurred while processing your request.
</h2>
</asp:Content>
One thing that may be different is that this app was created back when MVC Beta was the latest version, and was upgraded to the RC and then RTM as they were released. Might there have been some kooky setting that is left over from there?
I can get this working on other apps, so I'm a little flummoxed.