Global error handler
-
Is there a way to log uncaught exceptions ? Something like an event which fires when an exception is uncaught. I am trying to exit my application gracefully after logging the exception occurred.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
Is there a way to log uncaught exceptions ? Something like an event which fires when an exception is uncaught. I am trying to exit my application gracefully after logging the exception occurred.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
You need to handle this event: Application..::.ThreadException Event[^]
Giorgi Dalakishvili #region signature my articles #endregion
-
Is there a way to log uncaught exceptions ? Something like an event which fires when an exception is uncaught. I am trying to exit my application gracefully after logging the exception occurred.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
You need to handle this event: Application..::.ThreadException Event[^]
Giorgi Dalakishvili #region signature my articles #endregion
That's great. Thanks Giorgi. [edit] I am sorry I can't vote for you as CP is not allowing me to vote on messages. I am getting Forbidden message. [/edit]
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
Is there a way to log uncaught exceptions ? Something like an event which fires when an exception is uncaught. I am trying to exit my application gracefully after logging the exception occurred.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
Check this[^] Hope it helps
kss
-
Well the exception is still detected somewhere, so there must be a way to log that error. Why not just design your program so that exceptions are handled? - A well designed program shouldn't be producing any unhandled exceptions. Mark.
MarkBrock wrote:
A well designed program shouldn't be producing any unhandled exceptions.
It might be correct. But since I don't know my user's system configurations and other settings, I need to make sure that all exceptions are passing through the handler which I defined.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
That's great. Thanks Giorgi. [edit] I am sorry I can't vote for you as CP is not allowing me to vote on messages. I am getting Forbidden message. [/edit]
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
Glad to help you :)
Giorgi Dalakishvili #region signature my articles #endregion
-
Well the exception is still detected somewhere, so there must be a way to log that error. Why not just design your program so that exceptions are handled? - A well designed program shouldn't be producing any unhandled exceptions. Mark.
-
Check this[^] Hope it helps
kss
fearless stallion wrote:
Hope it helps
Indeed :)
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
:laugh: a wel produced program shouldnt produce any exceptions at all :laugh: but thats just not reality.
blakey404 wrote:
but thats just not reality.
True. No one can handle all exceptions.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
blakey404 wrote:
but thats just not reality.
True. No one can handle all exceptions.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions