[Mono-bugs] [Bug 526297] New: System.Web.Mvc.HandleErrorAttribute not working due to System.Web.HttpResponseWrapper.TrySkipIisCustomErrors being not implemented
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed Jul 29 06:16:21 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=526297
Summary: System.Web.Mvc.HandleErrorAttribute not working due to
System.Web.HttpResponseWrapper.TrySkipIisCustomErrors
being not implemented
Classification: Mono
Product: Mono: Class Libraries
Version: 2.4.x
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Web
AssignedTo: mhabersack at novell.com
ReportedBy: s.volchkov at gmail.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Created an attachment (id=308847)
--> (http://bugzilla.novell.com/attachment.cgi?id=308847)
Mvc Web application illustrating the issue
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1)
Gecko/20090715 Firefox/3.5.1 (.NET CLR 4.0.20506)
On Mono, [HandleError] attribute does not work as it does with Microsoft.NET:
its OnException method throws exception itself in the following line:
filterContext.HttpContext.Response.TrySkipIisCustomErrors = true;
In Mono, TrySkipIisCustomErrors property of System.Web.HttpResponseWrapper
class apparently is not implemented (checked both trunk and 2.4 branch).
As a result, the control is passed to the general ASP.NET exception handler,
configurable in Web.config using <customErrors> option.
Reproducible: Always
Steps to Reproduce:
1. Create a default MVC project in Visual Studio (its HomeController has
[HandleError] attribute set).
2. Add <customErrors mode="On" /> option to Web.config (otherwise,
HandleErrorAttribute does nothing).
3. Make some method of the controller (e.g. Index) throw an exception.
4. Launch the Web application (to do that on Mono, I used Publish feature of
the Visual Studio and then run xsp2 in the published directory).
Actual Results:
After opening the Web application in the browser, standard ASP.NET error page
"Server Error in '/' Application" appears, instructing how to modify Web.config
to see the actual error.
Expected Results:
The expected result was to see the Web page rendered by MVC.
Please find attached an Mvc Web project. It is basically a default Mvc project
created by Visual Studio, with modifications described in "steps to reproduce"
above. Additionally, a copy of HandleErrorAttribute class has been added, named
MyHandleErrorAttribute, that logs exceptions to the console in OnException
method. HomeController uses [MyHandleError] attribute to demonstrate the
exception; to see the actual reported behavior, change it to the default
[HandleError].
The archive also contains a the published version of the project, which can be
run directly in mono using xsp.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list