'OnException'方法不处理所有异常 [英] 'OnException' method does not handling all exceptions

查看:553
本文介绍了'OnException'方法不处理所有异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用HandleErrror属性处理错误时创建错误日志文件。但并非所有异常都保存在日志文件中。我也在我的代码中使用try catch。如果我们以这种方式处理错误那么我们可以使用尝试捕获或不.. .. div class =h2_lin>解决方案

Hai



使用Try尝试捕获错误的最佳方法。仅限,开发人员必须在每个函数中使用Try ... Catch块其他明智的代码异常中止,我的意思是用户使用网站或Windows应用程序,如果发生任何错误,则转到异常catch块并显示错误消息并继续使用,如果不使用试试......如果错误发现它会停止网站或Windows应用程序并需要打开表单起点(再次登录等等)



所以在每个函数中使用Try ... Catch ...最后。


i am creating error log file while handling error using HandleErrror Attribute..but not all exceptions are saving in log file..i am also using try catch in my code.if we are handling errors in this way then can we use try catch or not..

解决方案

Hai

The best way to capture error using Try...Catch only,developer must use Try...Catch block in each function other wise code abort abnormally, i mean it user use website or windows application,if any error occur it goes to exception catch block and the show error message and continue to use,if not use Try ...Catch if error occor it stop the website or windows application and need to open form starting point(again login and so on)

So use Try...Catch...Finally in each function.


这篇关于'OnException'方法不处理所有异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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