Global error handling in ASP.NET

前端 未结 2 1496
刺人心
刺人心 2021-02-14 20:38

Is there anything wrong with catching errors in an ASP.NET application globally (eg: Global.asax)? I have viewed the question Good error handling practice and it doesn\'t really

2条回答
  •  盖世英雄少女心
    2021-02-14 20:59

    The global place to handle uncatched Exceptions would be in Global.asax by handling Application_Error. As John pointed out, you should always handle exceptions as close as possible to where they might occur and react appropriately.

提交回复
热议问题