I'm going to answer the question "is this a good idea?" part of the question: No.
It is not recommended that you use exceptions to implement expected flow control. It is possible, but not expected, just as you can make all your Strings variables and implement all your data structures in arrays.
Try-blocks are designed to create a scope boundary that has certain guarantees upon completion ( catch and finally behavior). The code observer sees:
try{ ... }catch(Exception x){}
will very much strive to either reconstruct x (possibly wrapped) or completely exclude the block.
Try-blocks are not what is inside their area. This is what standard loop designs and, better, features. Your question just disappears if you put the scope in a function:
RetVal doStuff(Arg arg){ //--do stuff---- if(//-------is condition met?--------//) return myResult; }
source share