Rewriting my firewall parser, and decided to start with solid error checking from the start using the try/catch methodology.
My question is if I call a class function instead of using return on failure is it proper to just use throw?
Like
I have already done it, and it seems to work fine. It just doesn't look right to me, and wanted to make sure I'm not committing some programming crime against humanity ( yah goto im looking at you ).Code:int parsThis::myJunk(int infostuff) { int payoff; if (infostuff > 0) { //Do some crap change up payoff return payoff; } throw 1; // throw here instead of using return with a catch(int i) in main func }