Maybe I'm wrong, but isn't a ``ValueError`` more appropriate?