generally better to use specific exceptions instead of the parent class.  Here I would have at least used "ValueError"