473,395 Members | 2,798 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,395 software developers and data experts.

Global Error Handler

Hi Guys

I have two questions.
1. Is there a way to set a handler to .NET application so that in case of
not caught exception my handler is called before application shutdown. I
want to send an email from this handler with details of error.
2. Is there a way to capture the text (with stack frame etc) displayed in a
dialog which is shown when unhandled execption is thrown

Thanks in advance for your help

Regards
Yeghia
Oct 10 '06 #1
2 1913
You may want to look at EntLib for managing how exceptions are handled.
Basically what you do is attach a top level handler when the application
starts up to the AppDomain's UnhandledException event which will begin
processing of the exception through the EntLib framework.

What *you* do is create custom handlers...for example, you may make one
that takes an exception and displays a simple message box or one that
displays a "nice" window like you're referring to and then perhaps an
additional one that logs to either the event log, a logging service,
etc...

The exception framework will run through all of your handlers (if
configured to do so) which would net you having the window show up as
well as the message being logged somewhere for later viewing.

http://www.microsoft.com/downloads/d...325B97A-9534-4
349-8038-D56B38EC394C&displaylang=en

-----Original Message-----
From: yeghia (sosy) [mailto:yh*@sosy-tech.com]
Posted At: Tuesday, October 10, 2006 1:57 PM
Posted To: microsoft.public.dotnet.general
Conversation: Global Error Handler
Subject: Global Error Handler

Hi Guys

I have two questions.
1. Is there a way to set a handler to .NET application so that in case
of
not caught exception my handler is called before application shutdown. I
want to send an email from this handler with details of error.
2. Is there a way to capture the text (with stack frame etc) displayed
in a
dialog which is shown when unhandled execption is thrown

Thanks in advance for your help

Regards
Yeghia
Oct 12 '06 #3

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

Similar topics

1
by: Timh Bergström | last post by:
Hi all! Can i do a global "on error" statement for all forms and modules instead of having "on error goto ErrHand" in each sub/function? The error should be catched to another form there the...
3
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a...
0
by: Mark | last post by:
There appear to be several ways to get the global error handler in global.asax.cs to fire repeatedly in a nasty endless loop. Is there a way to keep this event from firing only a handful of times...
6
by: fd123456 | last post by:
Er... Sorry to interrupt, but you CAN put methods and functions in the Global.asax file. You just have to make them static (Shared in VB). You can even use functions normally not available outside...
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. ...
0
by: hynek.cihlar | last post by:
A strange behaviour thatI found in ASP.NET 2.0. I am trying to issue a callback request (handled by ICallbackEventHandler and RaiseCallbackEvent) and a regular GET request in the client browser...
3
by: Rodrigo Juarez | last post by:
Hi Microsoft Visual Studio 2005, Visual Basic and winforms application I need a global error handler, where should I put that. Any examples? TIA Rodrigo Juarez
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...
20
by: teddysnips | last post by:
Weird. I have taken over responsibility for a legacy application, Access 2k3, split FE/BE. The client has reported a problem and I'm investigating. I didn't write the application. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
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...

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.