There is a way to handling exception and then moving to the next line in the code that the exception was thrown?
Example:
try {
cout << "Test Begin! 1... 2... 3..." << endl;
throw "A text!";
throw 1;
throw 2;
throw 3;
cout << "Yeah! Successful!!" << endl;
} catch (char* text) {
cout << ch << endl;
???(); //Go back to the previous line
}
catch (int i) {
cout << "Thrown " << i << endl;
???(); //Go back to the previous line
}
The output'll be:
Test Begin! 1... 2... 3...
A text!
Thrown 1
Thrown 2
Thrown 3
Yeah! Successful!!