ericnet
Programmer
- Mar 29, 2006
- 106
Hello,
I want to implement a system to handle all possible errors in my ASP.NET VB application. Now, in each aspx page, I have a Try...Catch block that handles the possibility of error while a code to store user activity is executed.
My plan is:
Every time an error happens in those Try...Catch blocks, register an error in the database, storing Error Message, Inner Exception, Source, Help Link, Session Number (stored in an in-memory cookie), and User Number (stored in a permanent cookie). While this error registration is done, the user will see the page normally, as is (without any error), but if an unexpected error happens during this error registration, I want to show a friendly general error page.
Ok, until here I know how to do it (or I would), but the part I don’ t know how to do it is register the general error in the database. I mean, store the same information I mentioned, but for that general error, so, Error Message, Inner Exception, Source, Help Link, Session Number (stored in an in-memory cookie), and User Number (stored in a permanent cookie). Where I have to put this code? In the web.config file? Or in the global.asax.vb file? And also, Is the idea I explained a good way to handle errors?
(I program all my code in line, without any IDE)
Experienced opinions will be welcomed
Thank you
I want to implement a system to handle all possible errors in my ASP.NET VB application. Now, in each aspx page, I have a Try...Catch block that handles the possibility of error while a code to store user activity is executed.
My plan is:
Every time an error happens in those Try...Catch blocks, register an error in the database, storing Error Message, Inner Exception, Source, Help Link, Session Number (stored in an in-memory cookie), and User Number (stored in a permanent cookie). While this error registration is done, the user will see the page normally, as is (without any error), but if an unexpected error happens during this error registration, I want to show a friendly general error page.
Ok, until here I know how to do it (or I would), but the part I don’ t know how to do it is register the general error in the database. I mean, store the same information I mentioned, but for that general error, so, Error Message, Inner Exception, Source, Help Link, Session Number (stored in an in-memory cookie), and User Number (stored in a permanent cookie). Where I have to put this code? In the web.config file? Or in the global.asax.vb file? And also, Is the idea I explained a good way to handle errors?
(I program all my code in line, without any IDE)
Experienced opinions will be welcomed
Thank you