Using inheritance to make the client throw different kinds of exceptions