global error handling

  • Thread starter Thread starter Kemal Taskin
  • Start date Start date
K

Kemal Taskin

hi all,

i have a question about asp.net's global error handling mechanisms.

Using customErrors in web.config seems to be fine, it redirects you
where you want. But how to display different messages according to
different types of errors?

Database may be down or the query is not correct. These are two
different errors and two different messages should be displayed for
them. We have Server.GetLastError() at hand, however this cannot
solve the problem because my project has many many users with
their sessions.

On the web people offer using mechanisms to store these last errors
packed with the session information, and then display the error
according to the 'last error in the session'. This may also not be
feasible because one person may open two sessions and get two
diferent errors in these sessions in the same time interval; resulting the
same error message occuring.

A redirect mechanism, allowing to pass arguments to the page (error
message in our case) would solve the problem but I couldn't find
such a solution.

Do someone know a solution to this problem?
Thanks for help...

Kemal Taskin
Ankara-Turkey
 
Hi Kemal:

GetLastError will return the last error for the request, so if you
Server.Transfer to the error page you should be able to pull the exact
last error generated by a user.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top