{"action":"created","comment":{"url":"https://api.github.com/repos/hpicgs/yats/pulls/comments/174929196","pull_request_review_id":104376250,"id":174929196,"diff_hunk":"@@ -61,3 +61,177 @@ TEST(scheduler_test, throw_on_creation)\n     EXPECT_THROW(yats::scheduler scheduler(std::move(pipeline)), std::runtime_error);\n }\n \n+TEST(scheduler_test, catch_task_exception)\n+{\n+    pipeline pipeline;\n+\n+    struct task {\n+       void run()\n+      {\n+          throw std::runtime_error(\"failed foo\");\n+      }\n+    };\n+\n+    pipeline.add<task>();\n+\n+    scheduler scheduler(std::move(pipeline));\n+    EXPECT_THROW(scheduler.run(), std::runtime_error);\n+}\n+\n+TEST(scheduler_test, catch_chained_task_exception)\n+{\n+    pipeline pipeline;\n+\n+    struct task {\n+      slot<int, 0> run()\n+      {\n+          throw std::runtime_error(\"failed foo\");\n+          return 1;\n+      }\n+    };\n+\n+    struct task2 {\n+      void run(yats::slot<int, 0> input)\n+      {\n+          std::cout << *input + 1 << std::endl;\n+      }\n+    };\n+\n+    auto first_task = pipeline.add<task>();\n+    auto second_task = pipeline.add<task2>();\n+\n+    first_task->output<0>() >> second_task->input<0>();\n+\n+    scheduler scheduler(std::move(pipeline));\n+    EXPECT_THROW(scheduler.run(), std::runtime_error);\n+}\n+\n+TEST(scheduler_test, catch_last_task_exception)\n+{\n+    pipeline pipeline;\n+\n+    struct task {\n+      slot<int, 0> run()\n+      {\n+          return 1;\n+      }\n+    };\n+\n+    struct task2 {\n+      void run(yats::slot<int, 0>)\n+      {\n+          throw std::runtime_error(\"failed foo\");\n+      }\n+    };\n+\n+    auto first_task = pipeline.add<task>();\n+    auto second_task = pipeline.add<task2>();\n+\n+    first_task->output<0>() >> second_task->input<0>();\n+\n+    scheduler scheduler(std::move(pipeline));\n+    EXPECT_THROW(scheduler.run(), std::runtime_error);\n+}\n+\n+TEST(scheduler_test, catch_last_task_main_thread_exception)\n+{\n+    pipeline pipeline;\n+\n+    struct task {\n+      slot<int, 0> run()\n+      {\n+          return 1;\n+      }\n+    };\n+\n+    struct task2 {\n+      thread_group thread_constraints()","path":"source/tests/yats-test/scheduler_test.cpp","position":88,"original_position":88,"commit_id":"3be0bf785804043c1b4ddb6b1555fba9fe270b59","original_commit_id":"3be0bf785804043c1b4ddb6b1555fba9fe270b59","user":{"login":"mflueggen","id":14051578,"avatar_url":"https://avatars2.githubusercontent.com/u/14051578?v=4","gravatar_id":"","url":"https://api.github.com/users/mflueggen","html_url":"https://github.com/mflueggen","followers_url":"https://api.github.com/users/mflueggen/followers","following_url":"https://api.github.com/users/mflueggen/following{/other_user}","gists_url":"https://api.github.com/users/mflueggen/gists{/gist_id}","starred_url":"https://api.github.com/users/mflueggen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mflueggen/subscriptions","organizations_url":"https://api.github.com/users/mflueggen/orgs","repos_url":"https://api.github.com/users/mflueggen/repos","events_url":"https://api.github.com/users/mflueggen/events{/privacy}","received_events_url":"https://api.github.com/users/mflueggen/received_events","type":"User","site_admin":false},"body":"Formatting issue.","created_at":"2018-03-15T20:54:07Z","updated_at":"2018-03-15T21:02:37Z","html_url":"https://github.com/hpicgs/yats/pull/130#discussion_r174929196","pull_request_url":"https://api.github.com/repos/hpicgs/yats/pulls/130","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/hpicgs/yats/pulls/comments/174929196"},"html":{"href":"https://github.com/hpicgs/yats/pull/130#discussion_r174929196"},"pull_request":{"href":"https://api.github.com/repos/hpicgs/yats/pulls/130"}}},"pull_request":{"url":"https://api.github.com/repos/hpicgs/yats/pulls/130","id":173482225,"html_url":"https://github.com/hpicgs/yats/pull/130","diff_url":"https://github.com/hpicgs/yats/pull/130.diff","patch_url":"https://github.com/hpicgs/yats/pull/130.patch","issue_url":"https://api.github.com/repos/hpicgs/yats/issues/130","number":130,"state":"open","locked":false,"title":"Catch task errors","user":{"login":"lawben","id":7422656,"avatar_url":"https://avatars0.githubusercontent.com/u/7422656?v=4","gravatar_id":"","url":"https://api.github.com/users/lawben","html_url":"https://github.com/lawben","followers_url":"https://api.github.com/users/lawben/followers","following_url":"https://api.github.com/users/lawben/following{/other_user}","gists_url":"https://api.github.com/users/lawben/gists{/gist_id}","starred_url":"https://api.github.com/users/lawben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lawben/subscriptions","organizations_url":"https://api.github.com/users/lawben/orgs","repos_url":"https://api.github.com/users/lawben/repos","events_url":"https://api.github.com/users/lawben/events{/privacy}","received_events_url":"https://api.github.com/users/lawben/received_events","type":"User","site_admin":false},"body":"This PR adds the ability to catch errors in tasks that run either on the main thread or in other threads.\r\nI am not entirely sure what needs to be cleared in case of an error. Currently, I am just throwing an error on the main thread. \r\n\r\nThings that were actually added: \r\n  - `scheduler_test.cpp` (second half)\r\n  - `abstract_task_container.h`: `failed()` and `get_error()`\r\n  - `scheduler.h`: `assert_no_task_failed()` \r\n\r\nIt should not be merged before #128. \r\nCloses #107.","created_at":"2018-03-07T15:17:19Z","updated_at":"2018-03-15T21:02:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90adad85220c05b4e7d5ad018c59b3df1fd4dbe9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Highlife1911","id":7109398,"avatar_url":"https://avatars1.githubusercontent.com/u/7109398?v=4","gravatar_id":"","url":"https://api.github.com/users/Highlife1911","html_url":"https://github.com/Highlife1911","followers_url":"https://api.github.com/users/Highlife1911/followers","following_url":"https://api.github.com/users/Highlife1911/following{/other_user}","gists_url":"https://api.github.com/users/Highlife1911/gists{/gist_id}","starred_url":"https://api.github.com/users/Highlife1911/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Highlife1911/subscriptions","organizations_url":"https://api.github.com/users/Highlife1911/orgs","repos_url":"https://api.github.com/users/Highlife1911/repos","events_url":"https://api.github.com/users/Highlife1911/events{/privacy}","received_events_url":"https://api.github.com/users/Highlife1911/received_events","type":"User","site_admin":false},{"login":"Zanthelo","id":12019838,"avatar_url":"https://avatars2.githubusercontent.com/u/12019838?v=4","gravatar_id":"","url":"https://api.github.com/users/Zanthelo","html_url":"https://github.com/Zanthelo","followers_url":"https://api.github.com/users/Zanthelo/followers","following_url":"https://api.github.com/users/Zanthelo/following{/other_user}","gists_url":"https://api.github.com/users/Zanthelo/gists{/gist_id}","starred_url":"https://api.github.com/users/Zanthelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zanthelo/subscriptions","organizations_url":"https://api.github.com/users/Zanthelo/orgs","repos_url":"https://api.github.com/users/Zanthelo/repos","events_url":"https://api.github.com/users/Zanthelo/events{/privacy}","received_events_url":"https://api.github.com/users/Zanthelo/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hpicgs/yats/pulls/130/commits","review_comments_url":"https://api.github.com/repos/hpicgs/yats/pulls/130/comments","review_comment_url":"https://api.github.com/repos/hpicgs/yats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpicgs/yats/issues/130/comments","statuses_url":"https://api.github.com/repos/hpicgs/yats/statuses/3be0bf785804043c1b4ddb6b1555fba9fe270b59","head":{"label":"hpicgs:exception_catch","ref":"exception_catch","sha":"3be0bf785804043c1b4ddb6b1555fba9fe270b59","user":{"login":"hpicgs","id":5174012,"avatar_url":"https://avatars1.githubusercontent.com/u/5174012?v=4","gravatar_id":"","url":"https://api.github.com/users/hpicgs","html_url":"https://github.com/hpicgs","followers_url":"https://api.github.com/users/hpicgs/followers","following_url":"https://api.github.com/users/hpicgs/following{/other_user}","gists_url":"https://api.github.com/users/hpicgs/gists{/gist_id}","starred_url":"https://api.github.com/users/hpicgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpicgs/subscriptions","organizations_url":"https://api.github.com/users/hpicgs/orgs","repos_url":"https://api.github.com/users/hpicgs/repos","events_url":"https://api.github.com/users/hpicgs/events{/privacy}","received_events_url":"https://api.github.com/users/hpicgs/received_events","type":"Organization","site_admin":false},"repo":{"id":110519860,"name":"yats","full_name":"hpicgs/yats","owner":{"login":"hpicgs","id":5174012,"avatar_url":"https://avatars1.githubusercontent.com/u/5174012?v=4","gravatar_id":"","url":"https://api.github.com/users/hpicgs","html_url":"https://github.com/hpicgs","followers_url":"https://api.github.com/users/hpicgs/followers","following_url":"https://api.github.com/users/hpicgs/following{/other_user}","gists_url":"https://api.github.com/users/hpicgs/gists{/gist_id}","starred_url":"https://api.github.com/users/hpicgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpicgs/subscriptions","organizations_url":"https://api.github.com/users/hpicgs/orgs","repos_url":"https://api.github.com/users/hpicgs/repos","events_url":"https://api.github.com/users/hpicgs/events{/privacy}","received_events_url":"https://api.github.com/users/hpicgs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpicgs/yats","description":"Yet another task scheduler","fork":false,"url":"https://api.github.com/repos/hpicgs/yats","forks_url":"https://api.github.com/repos/hpicgs/yats/forks","keys_url":"https://api.github.com/repos/hpicgs/yats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpicgs/yats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpicgs/yats/teams","hooks_url":"https://api.github.com/repos/hpicgs/yats/hooks","issue_events_url":"https://api.github.com/repos/hpicgs/yats/issues/events{/number}","events_url":"https://api.github.com/repos/hpicgs/yats/events","assignees_url":"https://api.github.com/repos/hpicgs/yats/assignees{/user}","branches_url":"https://api.github.com/repos/hpicgs/yats/branches{/branch}","tags_url":"https://api.github.com/repos/hpicgs/yats/tags","blobs_url":"https://api.github.com/repos/hpicgs/yats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpicgs/yats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpicgs/yats/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpicgs/yats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpicgs/yats/statuses/{sha}","languages_url":"https://api.github.com/repos/hpicgs/yats/languages","stargazers_url":"https://api.github.com/repos/hpicgs/yats/stargazers","contributors_url":"https://api.github.com/repos/hpicgs/yats/contributors","subscribers_url":"https://api.github.com/repos/hpicgs/yats/subscribers","subscription_url":"https://api.github.com/repos/hpicgs/yats/subscription","commits_url":"https://api.github.com/repos/hpicgs/yats/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpicgs/yats/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpicgs/yats/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpicgs/yats/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpicgs/yats/contents/{+path}","compare_url":"https://api.github.com/repos/hpicgs/yats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpicgs/yats/merges","archive_url":"https://api.github.com/repos/hpicgs/yats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpicgs/yats/downloads","issues_url":"https://api.github.com/repos/hpicgs/yats/issues{/number}","pulls_url":"https://api.github.com/repos/hpicgs/yats/pulls{/number}","milestones_url":"https://api.github.com/repos/hpicgs/yats/milestones{/number}","notifications_url":"https://api.github.com/repos/hpicgs/yats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpicgs/yats/labels{/name}","releases_url":"https://api.github.com/repos/hpicgs/yats/releases{/id}","deployments_url":"https://api.github.com/repos/hpicgs/yats/deployments","created_at":"2017-11-13T08:19:53Z","updated_at":"2018-03-14T16:34:56Z","pushed_at":"2018-03-15T20:42:46Z","git_url":"git://github.com/hpicgs/yats.git","ssh_url":"git@github.com:hpicgs/yats.git","clone_url":"https://github.com/hpicgs/yats.git","svn_url":"https://github.com/hpicgs/yats","homepage":null,"size":1473,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":11,"watchers":2,"default_branch":"master"}},"base":{"label":"hpicgs:master","ref":"master","sha":"22e5219051faa9ccc458dd2d3fe2db887d11c383","user":{"login":"hpicgs","id":5174012,"avatar_url":"https://avatars1.githubusercontent.com/u/5174012?v=4","gravatar_id":"","url":"https://api.github.com/users/hpicgs","html_url":"https://github.com/hpicgs","followers_url":"https://api.github.com/users/hpicgs/followers","following_url":"https://api.github.com/users/hpicgs/following{/other_user}","gists_url":"https://api.github.com/users/hpicgs/gists{/gist_id}","starred_url":"https://api.github.com/users/hpicgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpicgs/subscriptions","organizations_url":"https://api.github.com/users/hpicgs/orgs","repos_url":"https://api.github.com/users/hpicgs/repos","events_url":"https://api.github.com/users/hpicgs/events{/privacy}","received_events_url":"https://api.github.com/users/hpicgs/received_events","type":"Organization","site_admin":false},"repo":{"id":110519860,"name":"yats","full_name":"hpicgs/yats","owner":{"login":"hpicgs","id":5174012,"avatar_url":"https://avatars1.githubusercontent.com/u/5174012?v=4","gravatar_id":"","url":"https://api.github.com/users/hpicgs","html_url":"https://github.com/hpicgs","followers_url":"https://api.github.com/users/hpicgs/followers","following_url":"https://api.github.com/users/hpicgs/following{/other_user}","gists_url":"https://api.github.com/users/hpicgs/gists{/gist_id}","starred_url":"https://api.github.com/users/hpicgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpicgs/subscriptions","organizations_url":"https://api.github.com/users/hpicgs/orgs","repos_url":"https://api.github.com/users/hpicgs/repos","events_url":"https://api.github.com/users/hpicgs/events{/privacy}","received_events_url":"https://api.github.com/users/hpicgs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpicgs/yats","description":"Yet another task scheduler","fork":false,"url":"https://api.github.com/repos/hpicgs/yats","forks_url":"https://api.github.com/repos/hpicgs/yats/forks","keys_url":"https://api.github.com/repos/hpicgs/yats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpicgs/yats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpicgs/yats/teams","hooks_url":"https://api.github.com/repos/hpicgs/yats/hooks","issue_events_url":"https://api.github.com/repos/hpicgs/yats/issues/events{/number}","events_url":"https://api.github.com/repos/hpicgs/yats/events","assignees_url":"https://api.github.com/repos/hpicgs/yats/assignees{/user}","branches_url":"https://api.github.com/repos/hpicgs/yats/branches{/branch}","tags_url":"https://api.github.com/repos/hpicgs/yats/tags","blobs_url":"https://api.github.com/repos/hpicgs/yats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpicgs/yats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpicgs/yats/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpicgs/yats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpicgs/yats/statuses/{sha}","languages_url":"https://api.github.com/repos/hpicgs/yats/languages","stargazers_url":"https://api.github.com/repos/hpicgs/yats/stargazers","contributors_url":"https://api.github.com/repos/hpicgs/yats/contributors","subscribers_url":"https://api.github.com/repos/hpicgs/yats/subscribers","subscription_url":"https://api.github.com/repos/hpicgs/yats/subscription","commits_url":"https://api.github.com/repos/hpicgs/yats/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpicgs/yats/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpicgs/yats/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpicgs/yats/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpicgs/yats/contents/{+path}","compare_url":"https://api.github.com/repos/hpicgs/yats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpicgs/yats/merges","archive_url":"https://api.github.com/repos/hpicgs/yats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpicgs/yats/downloads","issues_url":"https://api.github.com/repos/hpicgs/yats/issues{/number}","pulls_url":"https://api.github.com/repos/hpicgs/yats/pulls{/number}","milestones_url":"https://api.github.com/repos/hpicgs/yats/milestones{/number}","notifications_url":"https://api.github.com/repos/hpicgs/yats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpicgs/yats/labels{/name}","releases_url":"https://api.github.com/repos/hpicgs/yats/releases{/id}","deployments_url":"https://api.github.com/repos/hpicgs/yats/deployments","created_at":"2017-11-13T08:19:53Z","updated_at":"2018-03-14T16:34:56Z","pushed_at":"2018-03-15T20:42:46Z","git_url":"git://github.com/hpicgs/yats.git","ssh_url":"git@github.com:hpicgs/yats.git","clone_url":"https://github.com/hpicgs/yats.git","svn_url":"https://github.com/hpicgs/yats","homepage":null,"size":1473,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":11,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpicgs/yats/pulls/130"},"html":{"href":"https://github.com/hpicgs/yats/pull/130"},"issue":{"href":"https://api.github.com/repos/hpicgs/yats/issues/130"},"comments":{"href":"https://api.github.com/repos/hpicgs/yats/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/hpicgs/yats/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/hpicgs/yats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpicgs/yats/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/hpicgs/yats/statuses/3be0bf785804043c1b4ddb6b1555fba9fe270b59"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mflueggen"}}