lib/usergrid/validation_errors.js
function ValidationErrors(errors) {
  this.errors = errors ? errors : {};

  this.addError = function(field, message) {
    if (!this.errors[field]) { this.errors[field] = []; }
    this.errors[field].push(util.format(message, field));
  };

  // omit field for full hash of errors
  this.getErrors = function(field) {
    if (field) {
      return this.errors[field];
    } else {
      return this.errors;
    }
  };

  this.hasErrors = function() {
    return _.keys(this.errors).length > 0;
  };

  this.isValidationErrors = function() {
    return true;
  };
}
function ValidationErrors(errors) {
  this.errors = errors ? errors : {};

  this.addError = function(field, message) {
    if (!this.errors[field]) { this.errors[field] = []; }
    this.errors[field].push(util.format(message, field));
  };

  // omit field for full hash of errors
  this.getErrors = function(field) {
    if (field) {
      return this.errors[field];
    } else {
      return this.errors;
    }
  };

  this.hasErrors = function() {
    return _.keys(this.errors).length > 0;
  };

  this.isValidationErrors = function() {
    return true;
  };
}
function ValidationErrors ( errors ) { this . errors = errors ? errors : { } ; this . addError = function ( field , message ) { if ( ! this . errors [ field ] ) { this . errors [ field ] = [ ] ; } this . errors [ field ] . push ( util . format ( message , field ) ) ; } ; // omit field for full hash of errors this . getErrors = function ( field ) { if ( field ) { return this . errors [ field ] ; } else { return this . errors ; } } ; this . hasErrors = function ( ) { return _ . keys ( this . errors ) . length > 0 ; } ; this . isValidationErrors = function ( ) { return true ; } ; }
errors is a hash of name -> errors
errors is a hash of name - > errors