I see that this has been merged already, but this exception should be more specific (e.g., ```except TypeError```)