My web server gets about 1000 to 1 hits of hacking attempts to valid requests (malformed headers, etc.) so I hope nginx and fcgi handle errors efficiently, because I pay for those cycles.
*for varying values of usually, YMMV, use your own judgement, etc
When I want a parameter is an integer, I don't check all the ways in which it's NOT an integer; the happy path is when it _is_ an int and the program can continue, and anything else is an _Error_. If it overflows, that's an error too.
i.e., happy means it's basically the longest path (aside from diagnosing the error).
The question is: should the subroutine set an error number or throw an exception? Knowing the cost for each might help me decide for various situations.