Not exactly. To answer this question, you need to understand how exception works. The key to understanding is this: they
propagate back to stack. To understand that, you also need to understand how the regular
call stack works (not to be mixed up with
exception stack built on top of the stack mechanism), this is what all the call-return system is based on, as well local variables and passing function parameters.
Structural exception handling acts as a kind of "time machine". I tried to explain it here:
Does Exception in C# Constructor Cause Caller Assignment to Fail?[
^],
where was stored .net exceptions in operating system[
^].
Now, what happens if you never handle exceptions up to the top stack frame of some thread, or if you handle only some of them? It depends on what thread is that. Consider the main thread. The exceptions propagate up and up the stack, until the propagation jumps to some runtime component which ultimately called your entry point,
main
function. Then it depends on what this component does. It may produce the dump. Or not. For other threads, the thread just terminates. The handling of unhandled exceptions may or may not happen. Normally, it doesn't happen, unless some runtime mechanism reserved some handling on top of threading mechanism.
All the scenarios explained above are abnormal. First of all, you should handle exceptions as little as possible, avoid handling them too locally. You have to do it only in special points I call "competency points". At the same time, you have to ultimately catch all exceptions somewhere on the top stack frame of
each thread. UI threads usually need handling on top stack frame of the biggest event-driven loop and recover from exceptions to continue the loop in all cases. UI library usually have predefined mechanism for that.
Se also my past answers:
Image taken from Webcam not getting saved on the server[
^],
Unhandled Exception : Access Violation[
^],
How do I catch native c++ exception in managed c++ class?[
^],
When i run an application an exception is caught how to handle this?[
^].
Some of my answers I referenced are about .NET. Don't be confused with that: it just doesn't matter, all my considerations are also applicable to C++, or almost anything else.
—SA