I got the demo code from http://blogs.msdn.com/b/webdev/archive/2013/11/22/debugging-owin-app-or-framework.aspx and it shows a sexy error page.
app.UseErrorPage(new ErrorPageOptions() { //Shows the OWIN environment dictionary keys and values. This detail is enabled by default if you are running your app from VS unless disabled in code. ShowEnvironment = true, //Hides cookie details ShowCookies = false, //Shows the lines of code throwing this exception. This detail is enabled by default if you are running your app from VS unless disabled in code. ShowSourceCode = true, }); app.Run(async context => { throw new Exception("UseErrorPage() demo"); await context.Response.WriteAsync("Error page demo"); }); }
However, if I throw an exception in the Controller action, the error page will not be displayed, and I still see YSOD.
So, I want to know which exceptions will be caught by UseErrorPage? Do I need additional settings to work?
owin katana
Jun guo
source share