{"action":"created","comment":{"url":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/comments/151463738","pull_request_review_id":77175734,"id":151463738,"diff_hunk":"@@ -153,12 +154,43 @@ def run_batch(env, queue_tracker, results, running_total, tests)\n \n     def precheck(env)\n       return 'default no-op pre_check' unless @pre_check\n-      continue = Helper::Command.exec_command(\n-        env, 'precheck', @pre_check, @logger, @log_decoration, timeout: @batch_timeout, capture: true\n-      )\n-      return continue if continue\n-      @logger.error('Pre-check failed: quitting immediately')\n-      raise 'Pre-check failed: quitting immediately'\n+\n+      begin\n+        return Helper::Command.exec_command(\n+          env, 'precheck', @pre_check, @logger, @log_decoration, timeout: @batch_timeout, capture: true\n+        )\n+      rescue\n+        @logger.error('Pre-check failed: quitting immediately')\n+        raise 'Pre-check failed: quitting immediately'\n+      end\n+    end\n+\n+    def on_batch_error(batch_env, batch_id, error_file, tests, error)\n+      unless @on_batch_error\n+        return 'default no-op on_batch_error'\n+      end\n+\n+      begin\n+        error_info = {\n+            'class'     => error.class,\n+            'message'   => error.message,\n+            'backtrace' => error.backtrace\n+        }\n+        batch_error_info = {\n+            'batch_id' => batch_id,\n+            'tests'    => tests,\n+            'error'    => error_info\n+        }.to_json\n+        File.write(error_file, batch_error_info)\n+        command = \"#{@on_batch_error} #{error_file}\"\n+        return Helper::Command.exec_command(\n+            batch_env, 'on_batch_error', command, @logger, @log_decoration, timeout: @batch_timeout, capture: true\n+        )\n+      rescue\n+        message = 'on-batch-error failed: quitting immediately'\n+        @logger.error(message)\n+        raise message","path":"lib/parallel_cucumber/worker.rb","position":53,"original_position":53,"commit_id":"eebc13ca549aa14b7d1f7312d68cab5ea3aea891","original_commit_id":"eebc13ca549aa14b7d1f7312d68cab5ea3aea891","user":{"login":"nwlunatic","id":428397,"avatar_url":"https://avatars3.githubusercontent.com/u/428397?v=4","gravatar_id":"","url":"https://api.github.com/users/nwlunatic","html_url":"https://github.com/nwlunatic","followers_url":"https://api.github.com/users/nwlunatic/followers","following_url":"https://api.github.com/users/nwlunatic/following{/other_user}","gists_url":"https://api.github.com/users/nwlunatic/gists{/gist_id}","starred_url":"https://api.github.com/users/nwlunatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwlunatic/subscriptions","organizations_url":"https://api.github.com/users/nwlunatic/orgs","repos_url":"https://api.github.com/users/nwlunatic/repos","events_url":"https://api.github.com/users/nwlunatic/events{/privacy}","received_events_url":"https://api.github.com/users/nwlunatic/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2017-11-16T16:21:05Z","updated_at":"2017-11-16T16:21:05Z","html_url":"https://github.com/badoo/parallel_cucumber/pull/26#discussion_r151463738","pull_request_url":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/comments/151463738"},"html":{"href":"https://github.com/badoo/parallel_cucumber/pull/26#discussion_r151463738"},"pull_request":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26"}},"in_reply_to_id":151446295},"pull_request":{"url":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26","id":153016585,"html_url":"https://github.com/badoo/parallel_cucumber/pull/26","diff_url":"https://github.com/badoo/parallel_cucumber/pull/26.diff","patch_url":"https://github.com/badoo/parallel_cucumber/pull/26.patch","issue_url":"https://api.github.com/repos/badoo/parallel_cucumber/issues/26","number":26,"state":"open","locked":false,"title":"Add --on-batch-error cli hook for custom batch errors handling","user":{"login":"nwlunatic","id":428397,"avatar_url":"https://avatars3.githubusercontent.com/u/428397?v=4","gravatar_id":"","url":"https://api.github.com/users/nwlunatic","html_url":"https://github.com/nwlunatic","followers_url":"https://api.github.com/users/nwlunatic/followers","following_url":"https://api.github.com/users/nwlunatic/following{/other_user}","gists_url":"https://api.github.com/users/nwlunatic/gists{/gist_id}","starred_url":"https://api.github.com/users/nwlunatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwlunatic/subscriptions","organizations_url":"https://api.github.com/users/nwlunatic/orgs","repos_url":"https://api.github.com/users/nwlunatic/repos","events_url":"https://api.github.com/users/nwlunatic/events{/privacy}","received_events_url":"https://api.github.com/users/nwlunatic/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-16T11:31:07Z","updated_at":"2017-11-16T16:21:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d57b571da1559ce50c2b4d459891425572b8ab5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26/commits","review_comments_url":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26/comments","review_comment_url":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/comments{/number}","comments_url":"https://api.github.com/repos/badoo/parallel_cucumber/issues/26/comments","statuses_url":"https://api.github.com/repos/badoo/parallel_cucumber/statuses/eebc13ca549aa14b7d1f7312d68cab5ea3aea891","head":{"label":"nwlunatic:on_batch_error","ref":"on_batch_error","sha":"eebc13ca549aa14b7d1f7312d68cab5ea3aea891","user":{"login":"nwlunatic","id":428397,"avatar_url":"https://avatars3.githubusercontent.com/u/428397?v=4","gravatar_id":"","url":"https://api.github.com/users/nwlunatic","html_url":"https://github.com/nwlunatic","followers_url":"https://api.github.com/users/nwlunatic/followers","following_url":"https://api.github.com/users/nwlunatic/following{/other_user}","gists_url":"https://api.github.com/users/nwlunatic/gists{/gist_id}","starred_url":"https://api.github.com/users/nwlunatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwlunatic/subscriptions","organizations_url":"https://api.github.com/users/nwlunatic/orgs","repos_url":"https://api.github.com/users/nwlunatic/repos","events_url":"https://api.github.com/users/nwlunatic/events{/privacy}","received_events_url":"https://api.github.com/users/nwlunatic/received_events","type":"User","site_admin":false},"repo":{"id":110551559,"name":"parallel_cucumber","full_name":"nwlunatic/parallel_cucumber","owner":{"login":"nwlunatic","id":428397,"avatar_url":"https://avatars3.githubusercontent.com/u/428397?v=4","gravatar_id":"","url":"https://api.github.com/users/nwlunatic","html_url":"https://github.com/nwlunatic","followers_url":"https://api.github.com/users/nwlunatic/followers","following_url":"https://api.github.com/users/nwlunatic/following{/other_user}","gists_url":"https://api.github.com/users/nwlunatic/gists{/gist_id}","starred_url":"https://api.github.com/users/nwlunatic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwlunatic/subscriptions","organizations_url":"https://api.github.com/users/nwlunatic/orgs","repos_url":"https://api.github.com/users/nwlunatic/repos","events_url":"https://api.github.com/users/nwlunatic/events{/privacy}","received_events_url":"https://api.github.com/users/nwlunatic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nwlunatic/parallel_cucumber","description":null,"fork":true,"url":"https://api.github.com/repos/nwlunatic/parallel_cucumber","forks_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/forks","keys_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/teams","hooks_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/hooks","issue_events_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/issues/events{/number}","events_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/events","assignees_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/assignees{/user}","branches_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/branches{/branch}","tags_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/tags","blobs_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/git/refs{/sha}","trees_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/statuses/{sha}","languages_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/languages","stargazers_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/stargazers","contributors_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/contributors","subscribers_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/subscribers","subscription_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/subscription","commits_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/commits{/sha}","git_commits_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/git/commits{/sha}","comments_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/comments{/number}","issue_comment_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/issues/comments{/number}","contents_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/contents/{+path}","compare_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/merges","archive_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/downloads","issues_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/issues{/number}","pulls_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/pulls{/number}","milestones_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/milestones{/number}","notifications_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/labels{/name}","releases_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/releases{/id}","deployments_url":"https://api.github.com/repos/nwlunatic/parallel_cucumber/deployments","created_at":"2017-11-13T13:27:26Z","updated_at":"2017-11-13T13:27:27Z","pushed_at":"2017-11-16T14:26:54Z","git_url":"git://github.com/nwlunatic/parallel_cucumber.git","ssh_url":"git@github.com:nwlunatic/parallel_cucumber.git","clone_url":"https://github.com/nwlunatic/parallel_cucumber.git","svn_url":"https://github.com/nwlunatic/parallel_cucumber","homepage":"","size":120,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"badoo:master","ref":"master","sha":"273f79ed8217cb537fb19761742f426b058168a0","user":{"login":"badoo","id":1277442,"avatar_url":"https://avatars3.githubusercontent.com/u/1277442?v=4","gravatar_id":"","url":"https://api.github.com/users/badoo","html_url":"https://github.com/badoo","followers_url":"https://api.github.com/users/badoo/followers","following_url":"https://api.github.com/users/badoo/following{/other_user}","gists_url":"https://api.github.com/users/badoo/gists{/gist_id}","starred_url":"https://api.github.com/users/badoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badoo/subscriptions","organizations_url":"https://api.github.com/users/badoo/orgs","repos_url":"https://api.github.com/users/badoo/repos","events_url":"https://api.github.com/users/badoo/events{/privacy}","received_events_url":"https://api.github.com/users/badoo/received_events","type":"Organization","site_admin":false},"repo":{"id":47416424,"name":"parallel_cucumber","full_name":"badoo/parallel_cucumber","owner":{"login":"badoo","id":1277442,"avatar_url":"https://avatars3.githubusercontent.com/u/1277442?v=4","gravatar_id":"","url":"https://api.github.com/users/badoo","html_url":"https://github.com/badoo","followers_url":"https://api.github.com/users/badoo/followers","following_url":"https://api.github.com/users/badoo/following{/other_user}","gists_url":"https://api.github.com/users/badoo/gists{/gist_id}","starred_url":"https://api.github.com/users/badoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badoo/subscriptions","organizations_url":"https://api.github.com/users/badoo/orgs","repos_url":"https://api.github.com/users/badoo/repos","events_url":"https://api.github.com/users/badoo/events{/privacy}","received_events_url":"https://api.github.com/users/badoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/badoo/parallel_cucumber","description":null,"fork":false,"url":"https://api.github.com/repos/badoo/parallel_cucumber","forks_url":"https://api.github.com/repos/badoo/parallel_cucumber/forks","keys_url":"https://api.github.com/repos/badoo/parallel_cucumber/keys{/key_id}","collaborators_url":"https://api.github.com/repos/badoo/parallel_cucumber/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/badoo/parallel_cucumber/teams","hooks_url":"https://api.github.com/repos/badoo/parallel_cucumber/hooks","issue_events_url":"https://api.github.com/repos/badoo/parallel_cucumber/issues/events{/number}","events_url":"https://api.github.com/repos/badoo/parallel_cucumber/events","assignees_url":"https://api.github.com/repos/badoo/parallel_cucumber/assignees{/user}","branches_url":"https://api.github.com/repos/badoo/parallel_cucumber/branches{/branch}","tags_url":"https://api.github.com/repos/badoo/parallel_cucumber/tags","blobs_url":"https://api.github.com/repos/badoo/parallel_cucumber/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/badoo/parallel_cucumber/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/badoo/parallel_cucumber/git/refs{/sha}","trees_url":"https://api.github.com/repos/badoo/parallel_cucumber/git/trees{/sha}","statuses_url":"https://api.github.com/repos/badoo/parallel_cucumber/statuses/{sha}","languages_url":"https://api.github.com/repos/badoo/parallel_cucumber/languages","stargazers_url":"https://api.github.com/repos/badoo/parallel_cucumber/stargazers","contributors_url":"https://api.github.com/repos/badoo/parallel_cucumber/contributors","subscribers_url":"https://api.github.com/repos/badoo/parallel_cucumber/subscribers","subscription_url":"https://api.github.com/repos/badoo/parallel_cucumber/subscription","commits_url":"https://api.github.com/repos/badoo/parallel_cucumber/commits{/sha}","git_commits_url":"https://api.github.com/repos/badoo/parallel_cucumber/git/commits{/sha}","comments_url":"https://api.github.com/repos/badoo/parallel_cucumber/comments{/number}","issue_comment_url":"https://api.github.com/repos/badoo/parallel_cucumber/issues/comments{/number}","contents_url":"https://api.github.com/repos/badoo/parallel_cucumber/contents/{+path}","compare_url":"https://api.github.com/repos/badoo/parallel_cucumber/compare/{base}...{head}","merges_url":"https://api.github.com/repos/badoo/parallel_cucumber/merges","archive_url":"https://api.github.com/repos/badoo/parallel_cucumber/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/badoo/parallel_cucumber/downloads","issues_url":"https://api.github.com/repos/badoo/parallel_cucumber/issues{/number}","pulls_url":"https://api.github.com/repos/badoo/parallel_cucumber/pulls{/number}","milestones_url":"https://api.github.com/repos/badoo/parallel_cucumber/milestones{/number}","notifications_url":"https://api.github.com/repos/badoo/parallel_cucumber/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/badoo/parallel_cucumber/labels{/name}","releases_url":"https://api.github.com/repos/badoo/parallel_cucumber/releases{/id}","deployments_url":"https://api.github.com/repos/badoo/parallel_cucumber/deployments","created_at":"2015-12-04T16:41:29Z","updated_at":"2017-11-13T18:12:08Z","pushed_at":"2017-11-16T14:26:55Z","git_url":"git://github.com/badoo/parallel_cucumber.git","ssh_url":"git@github.com:badoo/parallel_cucumber.git","clone_url":"https://github.com/badoo/parallel_cucumber.git","svn_url":"https://github.com/badoo/parallel_cucumber","homepage":"","size":117,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":8,"forks":6,"open_issues":8,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26"},"html":{"href":"https://github.com/badoo/parallel_cucumber/pull/26"},"issue":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/issues/26"},"comments":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/badoo/parallel_cucumber/statuses/eebc13ca549aa14b7d1f7312d68cab5ea3aea891"}},"author_association":"NONE"}}
{"actor":{"display_login":"nwlunatic"}}