I am developing a web application on ASP.NET with c#, when a trace error occurs on the website I store the error in a database from the global.asax using the Application_Error method. This is working fine but there are many errors occurring like client disconnected. How can I handle this error from global.asax it will not be stored in the database?
I am developing a web application on ASP.NET with c#, when a trace error
Share
Assuming you don’t want to track them at all, I would suggest creating a black list of ignorable exceptions and compare against them using the type and partial message text as the comparison. The black list could be stored in a DB table that you just read on
ApplicationStartand cached or you could just hard code them.You could also extend the solution by storing a count of how often these blacklisted exceptions are getting caught and store them in the application cache. Then have an admin page that could list the count or average frequency etc. in case you need to diagnose if these exceptions are actually occurring due to something valid that should be looked into.
It all comes down to how important these exceptions are to you and if they do become important in the future, how easily you can diagnose the issue with what tools you have at hand.