{"action":"created","issue":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/658","repository_url":"https://api.github.com/repos/cucumber/cucumber-js","labels_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/658/labels{/name}","comments_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/658/comments","events_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/658/events","html_url":"https://github.com/cucumber/cucumber-js/issues/658","id":184561428,"number":658,"title":"Errors in this.AfterStep crashes cucumberjs","user":{"login":"floribon","id":2934743,"avatar_url":"https://avatars.githubusercontent.com/u/2934743?v=3","gravatar_id":"","url":"https://api.github.com/users/floribon","html_url":"https://github.com/floribon","followers_url":"https://api.github.com/users/floribon/followers","following_url":"https://api.github.com/users/floribon/following{/other_user}","gists_url":"https://api.github.com/users/floribon/gists{/gist_id}","starred_url":"https://api.github.com/users/floribon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floribon/subscriptions","organizations_url":"https://api.github.com/users/floribon/orgs","repos_url":"https://api.github.com/users/floribon/repos","events_url":"https://api.github.com/users/floribon/events{/privacy}","received_events_url":"https://api.github.com/users/floribon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-21T20:26:23Z","updated_at":"2016-12-04T18:02:21Z","closed_at":null,"body":"Given these hooks:\n\n```\nthis.After(() => {\n  throw new Error('boom scenario');\n});\n\nthis.AfterStep(() => {\n  throw new Error('boom step');\n});\n```\n\nThe first block will properly fail and terminate the scenario with formatters and everything.\n\nThe second block will crash the process:\n\n> Error: .../runtime.js:152 boom step\n>       at .../features/step_definitions/runtime.js:153:11\n>       at _combinedTickCallback (internal/process/next_tick.js:67:7)\n>       at process._tickCallback (internal/process/next_tick.js:98:9)\n> make: **\\* [test] Error 1\n\nI am pretty sure the same happens using promises/callbacks from these hooks. \n`callback(error)`only properly works from `this.After`.\n"},"comment":{"url":"https://api.github.com/repos/cucumber/cucumber-js/issues/comments/264719477","html_url":"https://github.com/cucumber/cucumber-js/issues/658#issuecomment-264719477","issue_url":"https://api.github.com/repos/cucumber/cucumber-js/issues/658","id":264719477,"user":{"login":"charlierudolph","id":1676758,"avatar_url":"https://avatars.githubusercontent.com/u/1676758?v=3","gravatar_id":"","url":"https://api.github.com/users/charlierudolph","html_url":"https://github.com/charlierudolph","followers_url":"https://api.github.com/users/charlierudolph/followers","following_url":"https://api.github.com/users/charlierudolph/following{/other_user}","gists_url":"https://api.github.com/users/charlierudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/charlierudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlierudolph/subscriptions","organizations_url":"https://api.github.com/users/charlierudolph/orgs","repos_url":"https://api.github.com/users/charlierudolph/repos","events_url":"https://api.github.com/users/charlierudolph/events{/privacy}","received_events_url":"https://api.github.com/users/charlierudolph/received_events","type":"User","site_admin":false},"created_at":"2016-12-04T18:02:21Z","updated_at":"2016-12-04T18:02:21Z","body":"In `2.0.0-rc1`, `this.AfterStep` / `this.AfterScenario` / `this.BeforeFeature` were removed in favor of using `registerHandler` with the event name.\r\n\r\n---\r\n\r\n@floribon can you please give an example of needing to fail a step in `AfterStep` instead of in the actual step itself?"}}
{"actor":{"display_login":"charlierudolph"}}