{"action":"created","issue":{"url":"https://api.github.com/repos/jagi/meteor-astronomy-validators/issues/33","labels_url":"https://api.github.com/repos/jagi/meteor-astronomy-validators/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/jagi/meteor-astronomy-validators/issues/33/comments","events_url":"https://api.github.com/repos/jagi/meteor-astronomy-validators/issues/33/events","html_url":"https://github.com/jagi/meteor-astronomy-validators/pull/33","id":113873364,"number":33,"title":"suggestion for .catchValidationException","user":{"login":"awei01","id":2857763,"avatar_url":"https://avatars.githubusercontent.com/u/2857763?v=3","gravatar_id":"","url":"https://api.github.com/users/awei01","html_url":"https://github.com/awei01","followers_url":"https://api.github.com/users/awei01/followers","following_url":"https://api.github.com/users/awei01/following{/other_user}","gists_url":"https://api.github.com/users/awei01/gists{/gist_id}","starred_url":"https://api.github.com/users/awei01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awei01/subscriptions","organizations_url":"https://api.github.com/users/awei01/orgs","repos_url":"https://api.github.com/users/awei01/repos","events_url":"https://api.github.com/users/awei01/events{/privacy}","received_events_url":"https://api.github.com/users/awei01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-28T17:22:44Z","updated_at":"2015-10-28T19:38:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jagi/meteor-astronomy-validators/pulls/33","html_url":"https://github.com/jagi/meteor-astronomy-validators/pull/33","diff_url":"https://github.com/jagi/meteor-astronomy-validators/pull/33.diff","patch_url":"https://github.com/jagi/meteor-astronomy-validators/pull/33.patch"},"body":"Hi,\r\n\r\nI thought it might be useful to return the exception if it's not something that `.catchValidationException()` can handle. Example:\r\n\r\n```\r\n// server\r\nif (!model.validate()) {\r\n    model.throwValidationException();\r\n}\r\nmodel.save();\r\nreturn model;\r\n\r\n// client\r\nMeteor.call('some-save-method', model, function(error, result) {\r\n    error = model.catchValidationException(error);\r\n    if (error) {\r\n        // do my own handling for a non-validation type exception\r\n        return;\r\n    } \r\n    // no errors, so do something else\r\n    alert('success');\r\n});\r\n\r\n```\r\n\r\nOtherwise, I don't think there's a way to distinguish when the error is handled by model or not. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jagi/meteor-astronomy-validators/issues/comments/151967537","html_url":"https://github.com/jagi/meteor-astronomy-validators/pull/33#issuecomment-151967537","issue_url":"https://api.github.com/repos/jagi/meteor-astronomy-validators/issues/33","id":151967537,"user":{"login":"awei01","id":2857763,"avatar_url":"https://avatars.githubusercontent.com/u/2857763?v=3","gravatar_id":"","url":"https://api.github.com/users/awei01","html_url":"https://github.com/awei01","followers_url":"https://api.github.com/users/awei01/followers","following_url":"https://api.github.com/users/awei01/following{/other_user}","gists_url":"https://api.github.com/users/awei01/gists{/gist_id}","starred_url":"https://api.github.com/users/awei01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awei01/subscriptions","organizations_url":"https://api.github.com/users/awei01/orgs","repos_url":"https://api.github.com/users/awei01/repos","events_url":"https://api.github.com/users/awei01/events{/privacy}","received_events_url":"https://api.github.com/users/awei01/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T19:38:26Z","updated_at":"2015-10-28T19:38:26Z","body":"seems more logical. updated PR."}}