如何判断我的global.asax捕获的错误是否显示在用户的屏幕上 [英] How to tell if an error captured by my global.asax was displayed on the screen of the user

查看:105
本文介绍了如何判断我的global.asax捕获的错误是否显示在用户的屏幕上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Global.asax文件中,我有一个Sub Application_Error(ByVal sender As Object,ByVal e As EventArgs),应该捕获应用程序遇到的所有错误(如果我错了,请纠正我)。



我的问题是,我看到错误记录显然没有失败,我的用户看到自定义错误页面。那么什么告诉我,如果有什么,异常的类型是否真的导致自定义错误页面显示。



我想要更好的错误处理和看任何洞察力或改善用户体验的方法。谢谢!

解决方案

用两个字:



处理所有错误在页面上,向用户显示出错误的消息。



将全局错误处理程序保留为未知的错误,以记录它们并修复它们在不久的将来,并向您的用户显示一般的错误页面。



有关更多信息和详细信息,我已经写下了这个答案:我该怎么做通用错误我的ASP.NET应用程序中的页面,以便它处理在提供该页面时触发的错误?


In my Global.asax file I have a Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) which "should" capture all errors experienced by the application (correct me if I'm wrong here).

My question is, I've seen errors recorded which apparently did not "fail" in terms of my users seeing the custom error page. So what would tell me, if anything, whether or not the type of exception actually caused the custom error page to show.

I want to get better at error handling and looking for any insight or ways to improve the user's experience. Thanks!

解决方案

In two words:

Handle all your errors at the page, and show to the user a message for what is do wrong.

Keep the global error handler for unknown to you errors, for log them and fix them in the near future, and show a general error page to your user.

For more informations and details I have write this answer: How do I make a "generic error" page in my ASP.NET application so that it handles errors triggered when serving that page itself?

这篇关于如何判断我的global.asax捕获的错误是否显示在用户的屏幕上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆