473,396 Members | 1,900 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,396 software developers and data experts.

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 1669
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...@gmail.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.net/

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...@gmail.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...@gmail.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.net/

On Mar 12, 11:04 am, "Mike Hofer" <kchighl...@gmail.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...@gmail.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.net/

On Mar 12, 11:04 am, "Mike Hofer" <kchighl...@gmail.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...@gmail.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...@gmail.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
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...
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...
63
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
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...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.