J
Jerad Rose
There are many things that confuse me about the way .NET handles errors and
was hoping somebody could shed some light on my confusion:
1) Why are some errors treated differently? For example, some errors seem
to be handled as expected by the Try-Catch blocks. But some throw an
"Unhandled Exception" in the JIT debugging window, and some in the normal
IDE Continue-Break window -- even when within a Try-Catch block. I've read
that this was fixed by compiling your app in Release Mode, but I tried this
and had no effect on error handling. The JIT window is shown and the app
continues until I end the task through the task manager.
2) I've read about the global "ThreadException" event, but this seems like a
very poor practice, as it catches errors at a global level, and you are
unable to handle them at the level to handle each exception separately. I
know this is a good "last resort" catch-all method, but I would much rather
be able to handle them on an individual basis. Is this not possible for
these "Unhandled Exceptions"? Or am I misunderstanding how the
ThreadException event works?
3) Where did "JIT" debugging come from, and how the heck do you get rid of
it? I like the fact that it shows you the stack trace, but since the app
continues, it renders the JIT window non-responsive, and I'm unable to view
the details of the error nor click any buttons (Stop/Continue).
I realize that I may be misunderstanding much about the error handling
methods of .NET, so if you have any good resources for learning about this
stuff, please let me know.
Thanks in advance for your help.
was hoping somebody could shed some light on my confusion:
1) Why are some errors treated differently? For example, some errors seem
to be handled as expected by the Try-Catch blocks. But some throw an
"Unhandled Exception" in the JIT debugging window, and some in the normal
IDE Continue-Break window -- even when within a Try-Catch block. I've read
that this was fixed by compiling your app in Release Mode, but I tried this
and had no effect on error handling. The JIT window is shown and the app
continues until I end the task through the task manager.
2) I've read about the global "ThreadException" event, but this seems like a
very poor practice, as it catches errors at a global level, and you are
unable to handle them at the level to handle each exception separately. I
know this is a good "last resort" catch-all method, but I would much rather
be able to handle them on an individual basis. Is this not possible for
these "Unhandled Exceptions"? Or am I misunderstanding how the
ThreadException event works?
3) Where did "JIT" debugging come from, and how the heck do you get rid of
it? I like the fact that it shows you the stack trace, but since the app
continues, it renders the JIT window non-responsive, and I'm unable to view
the details of the error nor click any buttons (Stop/Continue).
I realize that I may be misunderstanding much about the error handling
methods of .NET, so if you have any good resources for learning about this
stuff, please let me know.
Thanks in advance for your help.