This project is read-only.

Catch all ASP.NET exceptions, log and show an Orchard error page

Topics: Writing modules
Sep 5, 2013 at 4:46 PM
Quite often my site will show the ASP.NET YSOD exception screen - user tries to upload a large file to Media, enters "<" in a form field, etc. How can I catch all these exceptions, log them and display an error screen inside Orchard - with menus, user name, etc. ?
Sep 5, 2013 at 8:37 PM
This may help answering the first case (request limit):
This may help answering the second case (user enters "<"):
Sep 10, 2013 at 3:39 PM
Edited Sep 10, 2013 at 3:40 PM
Thanks Mr Schoorstra.

I've created "private void Application_Error(object sender, EventArgs e)" in Orchard.Web/Global.asax.cs, but in never gets hit. Any redirects inside have no effect and VS debugger never shows that method executing. Any idea what I'm doing wrong?