mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
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:
@@ -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.
|
||||
|
||||
8
src/Orchard.Web/Core/Shapes/Views/ErrorPage.cshtml
Normal file
8
src/Orchard.Web/Core/Shapes/Views/ErrorPage.cshtml
Normal 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>
|
||||
Reference in New Issue
Block a user