473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

global error handling

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
Nov 18 '05 #1
1 1084
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.

--
Scott
http://www.OdeToCode.com
On Tue, 10 Aug 2004 10:00:48 +0300, "Kemal Taskin"
<ke**********@enocta.com> wrote:
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


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JP | last post by:
I need to be able to trap errors at the application level. I added this code to the Global.asax file. The code I wrote is supposed to get the last error that was generated and write to the event...
17
by: MLH | last post by:
A97 Topic: If there is a way to preserve the values assigned to global variables when an untrapped runtime error occurs? I don't think there is, but I thought I'd ask. During development, I'm...
2
by: VM | last post by:
Is it possible to intercept all exception errors into one Try...Catch? I've tried wrapping Application.Run() in a Try...Catch, but it doesn't seem to work all the time. Thanks.
5
by: OHM | last post by:
Hi everyone, I have a problem with error handling and wondered if anyone has managed to implement a global exception handling model. Is it possible to ensure that you see all exceptions before...
2
by: tshad | last post by:
I have my error handling set up in Global.asax: Sub Application_Error(Sender As Object, E as EventArgs) In this procedure I call a function in a dll that will write out to a history file. ...
3
by: Doug | last post by:
Using Visual Studio 2005, SQL Server 2000, and ASP.NET/VB.NET for a Web Application. We have a System DSN using Windows NT authentication defined on the development box to connect to the SQL...
2
by: ===Steve L.=== | last post by:
does anyone know any site or ariticle provides exmaple for building a Global Error Handling Module in VB.Net? the module should be able to 1. prouduce friendly generic error msg for the users and...
24
by: onnodb | last post by:
Hi all, Currently, I'm working on an Access XP database app that uses two global objects in its code. These two objects are instances of "controller classes". For example, one of them manages...
7
by: Jason Kester | last post by:
Best I can tell, there are three basic ways you can deal with global error handling in ASP.NET. Namely: 1. Derive all your pages from a custom Page class, and override OnError() 2. Specify a...
1
by: John | last post by:
Hi I have a winform app with try/catch error handling implemented in key areas. Problem is errors can occur in other areas in situations that I may not foresee. Is there a way to implemented a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.