Apr 11, 2013 at 9:29am
Hello,
I want to know what are the best ways to deal with errors.
Basically I want to stop running the application.
For example:
void foo()
{
int a = 0;
if (a != true)
myErrorHandler::postMessage("a variable it's not true");
}
Something like that
Apr 11, 2013 at 9:47am
You can throw an exception.
Apr 11, 2013 at 9:47am
throw an exception. If it will be left unhandled it will stop your programm.
And if it isn't a critical error, you can catch it and deal with it.