{"action":"created","issue":{"url":"https://api.github.com/repos/jsanchesleao/enforcement/issues/2","labels_url":"https://api.github.com/repos/jsanchesleao/enforcement/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jsanchesleao/enforcement/issues/2/comments","events_url":"https://api.github.com/repos/jsanchesleao/enforcement/issues/2/events","html_url":"https://github.com/jsanchesleao/enforcement/issues/2","id":106202332,"number":2,"title":"Mocha error","user":{"login":"raine","id":11027,"avatar_url":"https://avatars.githubusercontent.com/u/11027?v=3","gravatar_id":"","url":"https://api.github.com/users/raine","html_url":"https://github.com/raine","followers_url":"https://api.github.com/users/raine/followers","following_url":"https://api.github.com/users/raine/following{/other_user}","gists_url":"https://api.github.com/users/raine/gists{/gist_id}","starred_url":"https://api.github.com/users/raine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raine/subscriptions","organizations_url":"https://api.github.com/users/raine/orgs","repos_url":"https://api.github.com/users/raine/repos","events_url":"https://api.github.com/users/raine/events{/privacy}","received_events_url":"https://api.github.com/users/raine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-13T06:57:14Z","updated_at":"2015-09-14T13:49:38Z","closed_at":null,"body":"In my mocha test I have a promise that is rejected with an error produced by enforcement.\r\n\r\nThis is what happens:\r\n\r\n```\r\nUnhandled rejection TypeError: Cannot read property 'split' of undefined\r\n    at node_modules/mocha/lib/utils.js:722:18\r\n```\r\n\r\nAfter that mocha watcher dies.\r\n\r\nLine 722 in that file is this:\r\n\r\n```\r\nstack = stack.split('\\n');\r\n```\r\n\r\nSo I tried adding `this.stack = '';` to `validationError.js` and that fixed it. There must be something wrong with this line in `validationError.js` that is supposed to get a stack trace:\r\n\r\n```\r\nError.captureStackTrace(this, this.constructor); //super helper method to include stack trace in error object\r\n```"},"comment":{"url":"https://api.github.com/repos/jsanchesleao/enforcement/issues/comments/140081115","html_url":"https://github.com/jsanchesleao/enforcement/issues/2#issuecomment-140081115","issue_url":"https://api.github.com/repos/jsanchesleao/enforcement/issues/2","id":140081115,"user":{"login":"jsanchesleao","id":990967,"avatar_url":"https://avatars.githubusercontent.com/u/990967?v=3","gravatar_id":"","url":"https://api.github.com/users/jsanchesleao","html_url":"https://github.com/jsanchesleao","followers_url":"https://api.github.com/users/jsanchesleao/followers","following_url":"https://api.github.com/users/jsanchesleao/following{/other_user}","gists_url":"https://api.github.com/users/jsanchesleao/gists{/gist_id}","starred_url":"https://api.github.com/users/jsanchesleao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsanchesleao/subscriptions","organizations_url":"https://api.github.com/users/jsanchesleao/orgs","repos_url":"https://api.github.com/users/jsanchesleao/repos","events_url":"https://api.github.com/users/jsanchesleao/events{/privacy}","received_events_url":"https://api.github.com/users/jsanchesleao/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T13:49:38Z","updated_at":"2015-09-14T13:49:38Z","body":"0.0.8 is there with that hotfix. Later I'll try https://www.npmjs.com/package/error, and check if this will break any existing code."}}