scottwrobinson / camo

A class-based ES6 ODM for Mongo-like databases.
556 stars 80 forks source link

Better handling for no found test functions in schema. #41

Open michaeljota opened 8 years ago

michaeljota commented 8 years ago

Right now if you put some invalid validator in the schema, it throws a not found error.

that._schema[key].match.test is not a function

In the example, 'match' it's the name of the invalid validator.

I guess it should throw some information about where it is being used.

scottwrobinson commented 8 years ago

Yes, there is a lot of room for improvement on the errors it throws. Most aren't descriptive enough.

I've added this to my to-do list. Thanks for pointing it out!