Files (or snippets of files) to set up a highly flexible custom errors system that works for jQuery AJAX and synchronous calls alike for an ASP.NET MVC project.
- Global.asax.cs
- during any application error, attempts to render appropriate view via ErrorsController action
- Controllers/Errors/ErrorsController
- renders the error views, could do custom logging
- Scripts/main.js
- turns on global jQuery AJAX error event to display the error page after a bad AJAX call
- Scripts/errors.js
- enables navigation out of error page when rendered after AJAX
- Web.config
- enables static custom error pages as a backup
- Site.Master
- Exposes Debug symbol to JavaScript