Get the Error type which cause the application crash
-
I am using Qt 4.8. I used qInstallMsgHandler() and i handle critical and fatal error like
void myMessageOutput(QtMsgType type, const char *msg) { switch (type) { case QtCriticalMsg: //restarts application break; case QtFatalMsg: // restarts application break; } }
It works properly when i get fatal or critical. But some time my application get crash without giving the critical or fatal msg. Is ther any way to get what type of error my application getting crash.
-
You are only catching the errors listed in here. Basically you have to call those functions listed on the right and your application will end up in your message handler with an appropriate error code. Therefore, you need to know where in your application critical conditions are being encountered. Unfortunately, it does not support a crystal ball functionality covering all possible errors.
-
if your library is throwing an exception it's just up to you to catch it: http://www.cplusplus.com/doc/tutorial/exceptions/
if it's just crashing because of a segmentation fault or similar there are libraries to convert them into exceptions: https://github.com/Plaristote/segvcatch