powmedia / backbone-forms

Form framework for BackboneJS with nested forms, editable lists and validation
MIT License
2.17k stars 413 forks source link

What "err.type" used for? #436

Closed mdesign83 closed 10 years ago

mdesign83 commented 10 years ago

https://github.com/powmedia/backbone-forms/blob/master/src/validators.js#L29

      var err = {
        type: options.type,
        message: _.isFunction(options.message) ? options.message(options) : options.message
      };

"type" is too common to search for in the code...

exussum12 commented 10 years ago

for showing the type of failure, Required, Regexp, custom validator etc. git grep err.type would help narrow it down

mdesign83 commented 10 years ago

Thank you! As I see only tests use it.