Try catch finally: Do something if no exception is thrown
I'm wondering, is there a way to only execute a block if no exception was thrown? The best I can come up with is this: bool exception = false; try{ // something }catch(Exception e){ exception = true; }finally{ if(!exception){ // i can do what i want here } } Is there a better way?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.