Mido Posted July 29, 2010 Share Posted July 29, 2010 Hello It's about exception handling... I have two if statements, one inside the other. And I want to throw an exception from each, if one of them is FALSE. What "technique" should I use? I think throwing same exception with the same message within two if's is a bit messy. like: if $x is true //go to 2nd if: if $y is true return value if $y is false: throw exception "Invalid number" if $x is false: throw exception "Invalid number" Thanks, Quote Link to comment Share on other sites More sharing options...
Mido Posted July 29, 2010 Author Share Posted July 29, 2010 I thought about adding throw-statement after the two if statements. Would that do it? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.