I am wondering can try..catch force execution to go into the catch and run code in there?
here example code:
try {
if (AnyConditionTrue) {
// run some code
}
else {
// go catch
}
} catch (Exception) {
// run some code here...
}
Rather than throwing an Exception in the
else, I would recommend extracting the code from yourcatchinto a method and call that from your else