Skip to content

Instantly share code, notes, and snippets.

@eddieajau
Created August 3, 2015 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddieajau/378870d61d8b7dd37376 to your computer and use it in GitHub Desktop.
Save eddieajau/378870d61d8b7dd37376 to your computer and use it in GitHub Desktop.
Waterline validation error
model.create(someData)
  .catch(function (err) {
    console.error('ValidationError:', err.ValidationError);
    console.error('Message:', err.message);
  });

Outputs:

ValidationError: {
  type: [{
    rule: 'in',
    message: '"in" validation rule failed for input: \'user\'' 
    }]
}
Message: [Error (E_VALIDATION) 1 attribute is invalid] Invalid attributes sent to entity:
• type
• "in" validation rule failed for input: 'user'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment