{"action":"created","issue":{"url":"https://api.github.com/repos/lykmapipo/sails-hook-validation/issues/4","labels_url":"https://api.github.com/repos/lykmapipo/sails-hook-validation/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/lykmapipo/sails-hook-validation/issues/4/comments","events_url":"https://api.github.com/repos/lykmapipo/sails-hook-validation/issues/4/events","html_url":"https://github.com/lykmapipo/sails-hook-validation/issues/4","id":60989938,"number":4,"title":"Unable to show validation errors","user":{"login":"adavia","id":2234616,"avatar_url":"https://avatars.githubusercontent.com/u/2234616?v=3","gravatar_id":"","url":"https://api.github.com/users/adavia","html_url":"https://github.com/adavia","followers_url":"https://api.github.com/users/adavia/followers","following_url":"https://api.github.com/users/adavia/following{/other_user}","gists_url":"https://api.github.com/users/adavia/gists{/gist_id}","starred_url":"https://api.github.com/users/adavia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adavia/subscriptions","organizations_url":"https://api.github.com/users/adavia/orgs","repos_url":"https://api.github.com/users/adavia/repos","events_url":"https://api.github.com/users/adavia/events{/privacy}","received_events_url":"https://api.github.com/users/adavia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-13T05:39:58Z","updated_at":"2015-03-13T20:33:25Z","closed_at":null,"body":"So i have been following all these steps in order to show the errors but i came up with nothing. Even when i try to access error.Errors i get undefined. So just to make sure im using sails 0.11 i have already set up the validations messages in my user model (same as the example) and then in my controller i did this:\r\n\r\n    module.exports = {\r\n    create: function(req, res, next) {\r\n        var userObj = {\r\n           username: req.param('username'),\r\n           email: req.param('email')\r\n        }\r\n\r\n    User.create(userObj).exec(function(err, user) {\r\n\t if (err) {\r\n\t      expect(err.Errors.email).to.exist; // Get undefined email error here\r\n\r\n        expect(err.Errors.email[0].message)\r\n            .to.equal(User.validationMessages.email.email);\r\n\r\n        expect(err.Errors.email[1].message)\r\n            .to.equal(User.validationMessages.email.required);\r\n\r\n\r\n        expect(err.Errors.username).to.exist;\r\n        expect(err.Errors.username[0].message)\r\n            .to.equal(User.validationMessages.username.required);\r\n\r\n        done();\r\n\t    }\r\n\t    if (user) {\r\n\t    \tconsole.log(\"hi\");\r\n    \t}else{\r\n      \treturn res.json(404, {err: 'User not found.'});\r\n    \t}\r\n\t  });\r\n\t},"},"comment":{"url":"https://api.github.com/repos/lykmapipo/sails-hook-validation/issues/comments/79356964","html_url":"https://github.com/lykmapipo/sails-hook-validation/issues/4#issuecomment-79356964","issue_url":"https://api.github.com/repos/lykmapipo/sails-hook-validation/issues/4","id":79356964,"user":{"login":"adavia","id":2234616,"avatar_url":"https://avatars.githubusercontent.com/u/2234616?v=3","gravatar_id":"","url":"https://api.github.com/users/adavia","html_url":"https://github.com/adavia","followers_url":"https://api.github.com/users/adavia/followers","following_url":"https://api.github.com/users/adavia/following{/other_user}","gists_url":"https://api.github.com/users/adavia/gists{/gist_id}","starred_url":"https://api.github.com/users/adavia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adavia/subscriptions","organizations_url":"https://api.github.com/users/adavia/orgs","repos_url":"https://api.github.com/users/adavia/repos","events_url":"https://api.github.com/users/adavia/events{/privacy}","received_events_url":"https://api.github.com/users/adavia/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T20:33:25Z","updated_at":"2015-03-13T20:33:25Z","body":"It doesnt work as expected.. Do you have any sample project where you have already implemented this functionality?"}}