Refactor exception existance validation to make HHVM happy