use TypeError

Use TypeError, not an application-level exception such as
InvalidPrototypeException based on CommanderException