{"action":"created","comment":{"url":"https://api.github.com/repos/LearnBoost/mongoose/pulls/comments/25447162","id":25447162,"diff_hunk":"@@ -451,7 +451,7 @@ SchemaType.prototype.validate = function (obj, message, type) {\n \n       throw new Error(msg);\n     }\n-    this.validate(arg.validator, arg);\n+    this.validate(arg.validator, arg.msg || arg, arg.type || undefined);","path":"lib/schematype.js","position":5,"original_position":5,"commit_id":"7049e97952416a42024b41e89c14ac21314cb8cb","original_commit_id":"7049e97952416a42024b41e89c14ac21314cb8cb","user":{"login":"vkarpov15","id":1620265,"avatar_url":"https://avatars.githubusercontent.com/u/1620265?v=3","gravatar_id":"","url":"https://api.github.com/users/vkarpov15","html_url":"https://github.com/vkarpov15","followers_url":"https://api.github.com/users/vkarpov15/followers","following_url":"https://api.github.com/users/vkarpov15/following{/other_user}","gists_url":"https://api.github.com/users/vkarpov15/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarpov15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarpov15/subscriptions","organizations_url":"https://api.github.com/users/vkarpov15/orgs","repos_url":"https://api.github.com/users/vkarpov15/repos","events_url":"https://api.github.com/users/vkarpov15/events{/privacy}","received_events_url":"https://api.github.com/users/vkarpov15/received_events","type":"User","site_admin":false},"body":"This is causing an obvious test failure on Travis - don't think you can implement this in exactly the same way as you did in 3.8.x because we did [some internal refactoring of validators](http://thecodebarbarian.com/2014/12/19/mongoose-397).","created_at":"2015-02-26T17:42:10Z","updated_at":"2015-02-26T17:42:10Z","html_url":"https://github.com/LearnBoost/mongoose/pull/2717#discussion_r25447162","pull_request_url":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717","_links":{"self":{"href":"https://api.github.com/repos/LearnBoost/mongoose/pulls/comments/25447162"},"html":{"href":"https://github.com/LearnBoost/mongoose/pull/2717#discussion_r25447162"},"pull_request":{"href":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717"}}},"pull_request":{"url":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717","id":30042447,"html_url":"https://github.com/LearnBoost/mongoose/pull/2717","diff_url":"https://github.com/LearnBoost/mongoose/pull/2717.diff","patch_url":"https://github.com/LearnBoost/mongoose/pull/2717.patch","issue_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2717","number":2717,"state":"open","locked":false,"title":"Support custom error type for validators.","user":{"login":"rodriguise","id":3108711,"avatar_url":"https://avatars.githubusercontent.com/u/3108711?v=3","gravatar_id":"","url":"https://api.github.com/users/rodriguise","html_url":"https://github.com/rodriguise","followers_url":"https://api.github.com/users/rodriguise/followers","following_url":"https://api.github.com/users/rodriguise/following{/other_user}","gists_url":"https://api.github.com/users/rodriguise/gists{/gist_id}","starred_url":"https://api.github.com/users/rodriguise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodriguise/subscriptions","organizations_url":"https://api.github.com/users/rodriguise/orgs","repos_url":"https://api.github.com/users/rodriguise/repos","events_url":"https://api.github.com/users/rodriguise/events{/privacy}","received_events_url":"https://api.github.com/users/rodriguise/received_events","type":"User","site_admin":false},"body":"The mongoose-validator project has been updated to pass a custom error type name to the validator. This will check the old style msg and new type fields. The resulting errors will have the custom type in err.properties.type and err.kind fields.","created_at":"2015-02-26T01:14:36Z","updated_at":"2015-02-26T17:42:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2ddb0a82b879c5a45cd894aaf1ef23be3fb81e6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717/commits","review_comments_url":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717/comments","review_comment_url":"https://api.github.com/repos/LearnBoost/mongoose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/2717/comments","statuses_url":"https://api.github.com/repos/LearnBoost/mongoose/statuses/7049e97952416a42024b41e89c14ac21314cb8cb","head":{"label":"Qwasi:master","ref":"master","sha":"7049e97952416a42024b41e89c14ac21314cb8cb","user":{"login":"Qwasi","id":3368338,"avatar_url":"https://avatars.githubusercontent.com/u/3368338?v=3","gravatar_id":"","url":"https://api.github.com/users/Qwasi","html_url":"https://github.com/Qwasi","followers_url":"https://api.github.com/users/Qwasi/followers","following_url":"https://api.github.com/users/Qwasi/following{/other_user}","gists_url":"https://api.github.com/users/Qwasi/gists{/gist_id}","starred_url":"https://api.github.com/users/Qwasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qwasi/subscriptions","organizations_url":"https://api.github.com/users/Qwasi/orgs","repos_url":"https://api.github.com/users/Qwasi/repos","events_url":"https://api.github.com/users/Qwasi/events{/privacy}","received_events_url":"https://api.github.com/users/Qwasi/received_events","type":"Organization","site_admin":false},"repo":{"id":31298399,"name":"mongoose","full_name":"Qwasi/mongoose","owner":{"login":"Qwasi","id":3368338,"avatar_url":"https://avatars.githubusercontent.com/u/3368338?v=3","gravatar_id":"","url":"https://api.github.com/users/Qwasi","html_url":"https://github.com/Qwasi","followers_url":"https://api.github.com/users/Qwasi/followers","following_url":"https://api.github.com/users/Qwasi/following{/other_user}","gists_url":"https://api.github.com/users/Qwasi/gists{/gist_id}","starred_url":"https://api.github.com/users/Qwasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qwasi/subscriptions","organizations_url":"https://api.github.com/users/Qwasi/orgs","repos_url":"https://api.github.com/users/Qwasi/repos","events_url":"https://api.github.com/users/Qwasi/events{/privacy}","received_events_url":"https://api.github.com/users/Qwasi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Qwasi/mongoose","description":"MongoDB object modeling designed to work in an asynchronous environment.","fork":true,"url":"https://api.github.com/repos/Qwasi/mongoose","forks_url":"https://api.github.com/repos/Qwasi/mongoose/forks","keys_url":"https://api.github.com/repos/Qwasi/mongoose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Qwasi/mongoose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Qwasi/mongoose/teams","hooks_url":"https://api.github.com/repos/Qwasi/mongoose/hooks","issue_events_url":"https://api.github.com/repos/Qwasi/mongoose/issues/events{/number}","events_url":"https://api.github.com/repos/Qwasi/mongoose/events","assignees_url":"https://api.github.com/repos/Qwasi/mongoose/assignees{/user}","branches_url":"https://api.github.com/repos/Qwasi/mongoose/branches{/branch}","tags_url":"https://api.github.com/repos/Qwasi/mongoose/tags","blobs_url":"https://api.github.com/repos/Qwasi/mongoose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Qwasi/mongoose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Qwasi/mongoose/git/refs{/sha}","trees_url":"https://api.github.com/repos/Qwasi/mongoose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Qwasi/mongoose/statuses/{sha}","languages_url":"https://api.github.com/repos/Qwasi/mongoose/languages","stargazers_url":"https://api.github.com/repos/Qwasi/mongoose/stargazers","contributors_url":"https://api.github.com/repos/Qwasi/mongoose/contributors","subscribers_url":"https://api.github.com/repos/Qwasi/mongoose/subscribers","subscription_url":"https://api.github.com/repos/Qwasi/mongoose/subscription","commits_url":"https://api.github.com/repos/Qwasi/mongoose/commits{/sha}","git_commits_url":"https://api.github.com/repos/Qwasi/mongoose/git/commits{/sha}","comments_url":"https://api.github.com/repos/Qwasi/mongoose/comments{/number}","issue_comment_url":"https://api.github.com/repos/Qwasi/mongoose/issues/comments{/number}","contents_url":"https://api.github.com/repos/Qwasi/mongoose/contents/{+path}","compare_url":"https://api.github.com/repos/Qwasi/mongoose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Qwasi/mongoose/merges","archive_url":"https://api.github.com/repos/Qwasi/mongoose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Qwasi/mongoose/downloads","issues_url":"https://api.github.com/repos/Qwasi/mongoose/issues{/number}","pulls_url":"https://api.github.com/repos/Qwasi/mongoose/pulls{/number}","milestones_url":"https://api.github.com/repos/Qwasi/mongoose/milestones{/number}","notifications_url":"https://api.github.com/repos/Qwasi/mongoose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Qwasi/mongoose/labels{/name}","releases_url":"https://api.github.com/repos/Qwasi/mongoose/releases{/id}","created_at":"2015-02-25T05:15:24Z","updated_at":"2015-02-26T01:08:50Z","pushed_at":"2015-02-26T01:08:50Z","git_url":"git://github.com/Qwasi/mongoose.git","ssh_url":"git@github.com:Qwasi/mongoose.git","clone_url":"https://github.com/Qwasi/mongoose.git","svn_url":"https://github.com/Qwasi/mongoose","homepage":"http://mongoosejs.com","size":21184,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"LearnBoost:master","ref":"master","sha":"7603816521f05df02b75b5337415f58ce0f02de1","user":{"login":"LearnBoost","id":204174,"avatar_url":"https://avatars.githubusercontent.com/u/204174?v=3","gravatar_id":"","url":"https://api.github.com/users/LearnBoost","html_url":"https://github.com/LearnBoost","followers_url":"https://api.github.com/users/LearnBoost/followers","following_url":"https://api.github.com/users/LearnBoost/following{/other_user}","gists_url":"https://api.github.com/users/LearnBoost/gists{/gist_id}","starred_url":"https://api.github.com/users/LearnBoost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LearnBoost/subscriptions","organizations_url":"https://api.github.com/users/LearnBoost/orgs","repos_url":"https://api.github.com/users/LearnBoost/repos","events_url":"https://api.github.com/users/LearnBoost/events{/privacy}","received_events_url":"https://api.github.com/users/LearnBoost/received_events","type":"Organization","site_admin":false},"repo":{"id":597879,"name":"mongoose","full_name":"LearnBoost/mongoose","owner":{"login":"LearnBoost","id":204174,"avatar_url":"https://avatars.githubusercontent.com/u/204174?v=3","gravatar_id":"","url":"https://api.github.com/users/LearnBoost","html_url":"https://github.com/LearnBoost","followers_url":"https://api.github.com/users/LearnBoost/followers","following_url":"https://api.github.com/users/LearnBoost/following{/other_user}","gists_url":"https://api.github.com/users/LearnBoost/gists{/gist_id}","starred_url":"https://api.github.com/users/LearnBoost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LearnBoost/subscriptions","organizations_url":"https://api.github.com/users/LearnBoost/orgs","repos_url":"https://api.github.com/users/LearnBoost/repos","events_url":"https://api.github.com/users/LearnBoost/events{/privacy}","received_events_url":"https://api.github.com/users/LearnBoost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LearnBoost/mongoose","description":"MongoDB object modeling designed to work in an asynchronous environment.","fork":false,"url":"https://api.github.com/repos/LearnBoost/mongoose","forks_url":"https://api.github.com/repos/LearnBoost/mongoose/forks","keys_url":"https://api.github.com/repos/LearnBoost/mongoose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LearnBoost/mongoose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LearnBoost/mongoose/teams","hooks_url":"https://api.github.com/repos/LearnBoost/mongoose/hooks","issue_events_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/events{/number}","events_url":"https://api.github.com/repos/LearnBoost/mongoose/events","assignees_url":"https://api.github.com/repos/LearnBoost/mongoose/assignees{/user}","branches_url":"https://api.github.com/repos/LearnBoost/mongoose/branches{/branch}","tags_url":"https://api.github.com/repos/LearnBoost/mongoose/tags","blobs_url":"https://api.github.com/repos/LearnBoost/mongoose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LearnBoost/mongoose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LearnBoost/mongoose/git/refs{/sha}","trees_url":"https://api.github.com/repos/LearnBoost/mongoose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LearnBoost/mongoose/statuses/{sha}","languages_url":"https://api.github.com/repos/LearnBoost/mongoose/languages","stargazers_url":"https://api.github.com/repos/LearnBoost/mongoose/stargazers","contributors_url":"https://api.github.com/repos/LearnBoost/mongoose/contributors","subscribers_url":"https://api.github.com/repos/LearnBoost/mongoose/subscribers","subscription_url":"https://api.github.com/repos/LearnBoost/mongoose/subscription","commits_url":"https://api.github.com/repos/LearnBoost/mongoose/commits{/sha}","git_commits_url":"https://api.github.com/repos/LearnBoost/mongoose/git/commits{/sha}","comments_url":"https://api.github.com/repos/LearnBoost/mongoose/comments{/number}","issue_comment_url":"https://api.github.com/repos/LearnBoost/mongoose/issues/comments{/number}","contents_url":"https://api.github.com/repos/LearnBoost/mongoose/contents/{+path}","compare_url":"https://api.github.com/repos/LearnBoost/mongoose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LearnBoost/mongoose/merges","archive_url":"https://api.github.com/repos/LearnBoost/mongoose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LearnBoost/mongoose/downloads","issues_url":"https://api.github.com/repos/LearnBoost/mongoose/issues{/number}","pulls_url":"https://api.github.com/repos/LearnBoost/mongoose/pulls{/number}","milestones_url":"https://api.github.com/repos/LearnBoost/mongoose/milestones{/number}","notifications_url":"https://api.github.com/repos/LearnBoost/mongoose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LearnBoost/mongoose/labels{/name}","releases_url":"https://api.github.com/repos/LearnBoost/mongoose/releases{/id}","created_at":"2010-04-06T21:39:05Z","updated_at":"2015-02-26T15:23:25Z","pushed_at":"2015-02-25T20:14:31Z","git_url":"git://github.com/LearnBoost/mongoose.git","ssh_url":"git@github.com:LearnBoost/mongoose.git","clone_url":"https://github.com/LearnBoost/mongoose.git","svn_url":"https://github.com/LearnBoost/mongoose","homepage":"http://mongoosejs.com","size":36050,"stargazers_count":6304,"watchers_count":6304,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":933,"mirror_url":null,"open_issues_count":419,"forks":933,"open_issues":419,"watchers":6304,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717"},"html":{"href":"https://github.com/LearnBoost/mongoose/pull/2717"},"issue":{"href":"https://api.github.com/repos/LearnBoost/mongoose/issues/2717"},"comments":{"href":"https://api.github.com/repos/LearnBoost/mongoose/issues/2717/comments"},"review_comments":{"href":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717/comments"},"review_comment":{"href":"https://api.github.com/repos/LearnBoost/mongoose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LearnBoost/mongoose/pulls/2717/commits"},"statuses":{"href":"https://api.github.com/repos/LearnBoost/mongoose/statuses/7049e97952416a42024b41e89c14ac21314cb8cb"}}}}