allow type definitions to raise sensible exceptions in validate