473,857 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SURVEY: How are you doing Global Error Handling in ASP.NET

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 custom 500 handler in Web.Config

3. Specify a custom 500 handler in IIS

and I guess you could add:

4. Let them fall through & spit out ugly error messages
I'm curious to see how people are doing it in the real world.
Personally, I've always used option #1, as it seems to offer the most
flexibility, and I'm already using custom Page objects, so it's no
extra work.

I'm asking this because we're getting close to a public BETA release
of Regressor.NET, and am considering adding support for cases 2 and
3. Before I commit the resources though, I'd like to get a feel for
how many people would benefit from it.

I look forward to seeing what people have to say. Thanks for the
help!

Jason Kester
Automated Crash Reporting and Regression Testing for ASP.NET
http://www.regressor.net/

ps. If anybody is interested in becoming a Beta tester for
Regressor.NET, let me know!

Mar 12 '07 #1
7 1690
Jason Kester schrieb:
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 custom 500 handler in Web.Config

3. Specify a custom 500 handler in IIS

and I guess you could add:

4. Let them fall through & spit out ugly error messages
5. Use global.asax to catch errors

greets,
steve

--
Stefan Kalcher

Programming's just like sex, one mistake, you support it for life.
Mar 12 '07 #2
On Mar 12, 1:29 am, "Jason Kester" <jasonkes...@gm ail.comwrote:
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 custom 500 handler in Web.Config

3. Specify a custom 500 handler in IIS

and I guess you could add:

4. Let them fall through & spit out ugly error messages

I'm curious to see how people are doing it in the real world.
Personally, I've always used option #1, as it seems to offer the most
flexibility, and I'm already using custom Page objects, so it's no
extra work.

I'm asking this because we're getting close to a public BETA release
of Regressor.NET, and am considering adding support for cases 2 and
3. Before I commit the resources though, I'd like to get a feel for
how many people would benefit from it.

I look forward to seeing what people have to say. Thanks for the
help!

Jason Kester
Automated Crash Reporting and Regression Testing for ASP.NEThttp://www.regressor.n et/

ps. If anybody is interested in becoming a Beta tester for
Regressor.NET, let me know!
In my application, I do the following:

1.) All of my Web forms derive from a base Page class. OnError is
overridden to handle errors there.

2.) I also handle exceptions in Global.asax, in the event that I've
missed something.

3.) Wherever the default handlers in my base class and/or Global.asax
aren't appropriate, I implement suitable exception handling.

4.) The application has a custom web page, which is itself an aspx
page. Some might have a tough time with that design, but it's
*extremely* stable, and doesn't do anything subject to failure.

5.) Every exception is logged to the database (if possible) and to the
Windows event log.

Yeah. I take 'em very seriously.

Mar 12 '07 #3
I'm also a big fan of the custom Page idea. And I agree that logging
everything is important (that's why we wrote Regressor.NET!) It's
amazing how much you find out about your application when every single
exception gets logged.

Curious though, how many exceptions are you really seeing fall through
to Global.asax? I've seen a few posts on this thread from people that
are using Global.asax as a backup, but personally I've never had a
problem with the overriden OnError in my custom page classes. At
least I've never seen anything fall through in person, but then I
guess I'd never know if anything were slipping through the cracks...

Mike, do you forward crash reports directly to your bug tracking
software?

Jason Kester
Automated Crash Reporting and Regression Testing for ASP.NET
http://www.regressor.net/

On Mar 12, 11:04 am, "Mike Hofer" <kchighl...@gma il.comwrote:
In my application, I do the following:

1.) All of my Web forms derive from a base Page class. OnError is
overridden to handle errors there.

2.) I also handle exceptions in Global.asax, in the event that I've
missed something.

3.) Wherever the default handlers in my base class and/or Global.asax
aren't appropriate, I implement suitable exception handling.

4.) The application has a custom web page, which is itself an aspx
page. Some might have a tough time with that design, but it's
*extremely* stable, and doesn't do anything subject to failure.

5.) Every exception is logged to the database (if possible) and to the
Windows event log.

Yeah. I take 'em very seriously.- Hide quoted text -

- Show quoted text -

Mar 12 '07 #4
On Mar 12, 3:04 pm, "Jason Kester" <jasonkes...@gm ail.comwrote:
I'm also a big fan of the custom Page idea. And I agree that logging
everything is important (that's why we wrote Regressor.NET!) It's
amazing how much you find out about your application when every single
exception gets logged.

Curious though, how many exceptions are you really seeing fall through
to Global.asax? I've seen a few posts on this thread from people that
are using Global.asax as a backup, but personally I've never had a
problem with the overriden OnError in my custom page classes. At
least I've never seen anything fall through in person, but then I
guess I'd never know if anything were slipping through the cracks...

Mike, do you forward crash reports directly to your bug tracking
software?

Jason Kester
Automated Crash Reporting and Regression Testing for ASP.NEThttp://www.regressor.n et/

On Mar 12, 11:04 am, "Mike Hofer" <kchighl...@gma il.comwrote:
In my application, I do the following:
1.) All of my Web forms derive from a base Page class. OnError is
overridden to handle errors there.
2.) I also handle exceptions in Global.asax, in the event that I've
missed something.
3.) Wherever the default handlers in my base class and/or Global.asax
aren't appropriate, I implement suitable exception handling.
4.) The application has a custom web page, which is itself an aspx
page. Some might have a tough time with that design, but it's
*extremely* stable, and doesn't do anything subject to failure.
5.) Every exception is logged to the database (if possible) and to the
Windows event log.
Yeah. I take 'em very seriously.- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
Unfortunately, no, but that's due to the disconnected nature of our
system. The bug tracking database is housed here, at the software
shop, and the software itself is located on the production server at
the client -- in a different state, on a secure system, behind a
firewall, and to which we have no access. We are not permitted any
access to that system, due to security concerns. (It's a government
agency.)

The database contains an error log table; we are fortunate enough to
be able to receive backups of the database for data mining purposes,
and we mine that table to monitor exceptions for stuff that we missed.
I'm pleased to report that our unhandled exception rate is *extremely*
low.

We use BugTracker.NET here to track defects. It's rudimentary, but it
gets the job done for what we need. If we were able to write a secure
Web service to shuffle the data across the wire to BugTracker, I would
definitely be interested in doing that, but I don't think the client
will approve that any time in the near future. (Money is always a big
concern, and they have other things they want to get done at this
point in time. Since we are doing things pretty well "status quo,"
they're likely going to take the point of view that we can survive as
we are until it becomes a truly pressing concern. And if it ever came
to that, it would speak volumes about my code quality--they'd likely
need to hire a new developer, and I'd be brushing off my resume.)

Mar 12 '07 #5
On Mar 12, 3:04 pm, "Jason Kester" <jasonkes...@gm ail.comwrote:
I'm also a big fan of the custom Page idea. And I agree that logging
everything is important (that's why we wrote Regressor.NET!) It's
amazing how much you find out about your application when every single
exception gets logged.

Curious though, how many exceptions are you really seeing fall through
to Global.asax? I've seen a few posts on this thread from people that
are using Global.asax as a backup, but personally I've never had a
problem with the overriden OnError in my custom page classes. At
least I've never seen anything fall through in person, but then I
guess I'd never know if anything were slipping through the cracks...

Mike, do you forward crash reports directly to your bug tracking
software?

Jason Kester
Automated Crash Reporting and Regression Testing for ASP.NEThttp://www.regressor.n et/

On Mar 12, 11:04 am, "Mike Hofer" <kchighl...@gma il.comwrote:
In my application, I do the following:
1.) All of my Web forms derive from a base Page class. OnError is
overridden to handle errors there.
2.) I also handle exceptions in Global.asax, in the event that I've
missed something.
3.) Wherever the default handlers in my base class and/or Global.asax
aren't appropriate, I implement suitable exception handling.
4.) The application has a custom web page, which is itself an aspx
page. Some might have a tough time with that design, but it's
*extremely* stable, and doesn't do anything subject to failure.
5.) Every exception is logged to the database (if possible) and to the
Windows event log.
Yeah. I take 'em very seriously.- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
In regards to your questions regarding exceptions that fall through to
global.asax, I've only seen this a handful of times at best. But when
they did, I was *very* thankful it was there. Since we log everything
to our database, data mining helps us to uncover those unhandled
exceptions and treat them as critical defects that require immediate
resolution.

Mar 12 '07 #6
Yeah, it's tough having to work in the real world. Best practices
have a way of slipping through the cracks at most places.

Here at Expat Software we use Fogbugz, so we have the option of
sending out crash report distress calls either by Email or via HTTP.
Either way, Fogbugz will automatically log a new case for us.

Regardless, it sounds like you're well ahead of the game. I suspect
that most shops have never considered logging exceptions at all!

Jason Kester
Automated Crash Reporting and Regression Testing for ASP.NET
http://www.regressor.net/


On Mar 12, 12:14 pm, "Mike Hofer" <kchighl...@gma il.comwrote:
>
Unfortunately, no, but that's due to the disconnected nature of our
system. The bug tracking database is housed here, at the software
shop, and the software itself is located on the production server at
the client -- in a different state, on a secure system, behind a
firewall, and to which we have no access. We are not permitted any
access to that system, due to security concerns. (It's a government
agency.)
Mar 12 '07 #7
Yeah, it's tough having to work in the real world. Best practices
have a way of slipping through the cracks at most places.

Here at Expat Software we use Fogbugz, so we have the option of
sending out crash report distress calls either by Email or via HTTP.
Either way, Fogbugz will automatically log a new case for us.

Regardless, it sounds like you're well ahead of the game. I suspect
that most shops have never considered logging exceptions at all!

Jason Kester
Automated Crash Reporting and Regression Testing for ASP.NET
http://www.regressor.net/


On Mar 12, 12:14 pm, "Mike Hofer" <kchighl...@gma il.comwrote:
>
Unfortunately, no, but that's due to the disconnected nature of our
system. The bug tracking database is housed here, at the software
shop, and the software itself is located on the production server at
the client -- in a different state, on a secure system, behind a
firewall, and to which we have no access. We are not permitted any
access to that system, due to security concerns. (It's a government
agency.)
Mar 12 '07 #8

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

Similar topics

1
5724
by: GTF | last post by:
PHP Web Survey Idea.. I have been given an opportunity to create a web based survey. This is a fairly lengthy survey of 60 pages on paper (various multiple choice and free form). These are the Requirements: -Provide a web interface to a database -Database stores the data (duh), but the capacity to extract the data
17
5646
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 constantly running tests on imperfect code. On of the cumbersome jobs encountered is reassigning global vars their values after a close encounter with an untrapped runtime error. Rather than writing a procedure to simply reassign them all with a...
63
3540
by: Papadopoulos Giannis | last post by:
Which do you think is best? 1. a) type* p; b) type *p; 2. a) return (var); b) return(var); c) return var;
2
6967
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
2103
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 it becomes an unhandled exception. This is opposale to putting Try Catches around every statement
2
2358
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. This works for some errors, but not others. If it doesn't work, it stops there and the normal MS error page goes to the User.
3
2336
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 Server (both SQL and IIS are on the 192.168.1.2 server). We have "Identity Impersonate=true", and "CustomErrors mode=On" and "defaultRedirect="ErrorHandler.aspx" in web.config.
2
1412
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 gracefully exit the app. 2. capture vital error info for developers (such which application, where in the application, what type of error such as network, database connection, VB and so on, and error details) into a sql database for diagnosis. ...
0
344
by: martinig | last post by:
Outsourcing is often closely related to offshoring in software development, but you can outsource onshore and you can create offshore subsidiaries. This seems to be the current trend for large occidental organisation that want to profit for lower costs in countries like India, but maintain a high control on the process. However, developers in Europe or North America feel no differences if their Asian "competitor" work for a subsidiary or...
0
9923
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11082
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10394
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9549
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7939
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5774
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.