Ensure error thrown uses 'type' not 'name'