Is this really supposed to be unless and not if?

Also, please use raise for consistency.