I want that when and if the program will fail than it will be caught at this handler in order to do some guard notifications.
Is there a bottom handler or list of handlers that I need to register in order to be sure that a program cannot crash without passing through my handler?
Running on ubuntu and solution needed only to ubuntu
I need all kind of failure like exception memory allocation …
The simple answer is that there is no single point where you can handle all errors in the program. You can add a
try/catch (...)at inmainto handle exceptions that occur aftermainis entered and before it completes. You can also add a handler forterminatein C++. Then depending on the OS you will also need to handle other situations differently (invalid memory references can be handled in unix/linux by handling SIG_SEGV, but that will not work in Windows –AFAIK; some other errors might trigger different signals that could or not be handled…) Further than that, there might be errors that still get unnoticed (say an invalid memory access that happens to hit a valid memory address… the program will be incorrect, but the error might go undetected)