Exception handling in controllers. No more YSOD.

Create custom 500 error page (with admin theme) for all technical errors (i.e. exceptions that the app doesn't handle)
Implement an filter that will catch all unhandled exceptions and display the custom 500 page. Filter will also use ILogger to log the exception.

--HG--
branch : 1.x
extra : transplant_source : %F5P%0E%3EXv%A0%A3%85%DAu7%9Et%FB2l%86%FC%A3
This commit is contained in:
Suha Can
2011-06-08 14:27:05 -07:00
parent fa41a1b736
commit 51e43a624a
5 changed files with 71 additions and 1 deletions

View File

@@ -482,6 +482,9 @@
<ItemGroup>
<Content Include="Title\Views\Web.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Shapes\Views\ErrorPage.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,8 @@
<div>
<h1 id="page-title">@Html.TitleForPage(T("Oops. Something went wrong ... sorry"))</h1>
<div>
<p>@T("An unhandled exception has occurred. The exception message was : {0}", @Model.Message).Text</p>
<br />
<p>@T("Please refresh the page. If the error persists, go back.").Text</p>
</div>
</div>