{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments/179534702","pull_request_review_id":109795905,"id":179534702,"diff_hunk":"@@ -20,7 +20,19 @@ IN_PROCESS_HANDLER::OnExecuteRequestHandler()\n {\n     // First get the in process Application\n     HRESULT hr;\n-    hr = ((IN_PROCESS_APPLICATION*)m_pApplication)->LoadManagedApplication();\n+    try\n+    {\n+        hr = ((IN_PROCESS_APPLICATION*)m_pApplication)->LoadManagedApplication();\n+    }\n+    catch (const std::system_error& ex)\n+    {\n+        hr = ex.code().value();\n+    }\n+    catch (...)\n+    {\n+        hr = ERROR_EXCEPTION_IN_SERVICE;","path":"src/RequestHandler/inprocess/inprocesshandler.cpp","position":15,"original_position":15,"commit_id":"8a5754f0d74bcf90b25bd333d899d7c95af120e2","original_commit_id":"8a5754f0d74bcf90b25bd333d899d7c95af120e2","user":{"login":"jkotalik","id":8302101,"avatar_url":"https://avatars0.githubusercontent.com/u/8302101?v=4","gravatar_id":"","url":"https://api.github.com/users/jkotalik","html_url":"https://github.com/jkotalik","followers_url":"https://api.github.com/users/jkotalik/followers","following_url":"https://api.github.com/users/jkotalik/following{/other_user}","gists_url":"https://api.github.com/users/jkotalik/gists{/gist_id}","starred_url":"https://api.github.com/users/jkotalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkotalik/subscriptions","organizations_url":"https://api.github.com/users/jkotalik/orgs","repos_url":"https://api.github.com/users/jkotalik/repos","events_url":"https://api.github.com/users/jkotalik/events{/privacy}","received_events_url":"https://api.github.com/users/jkotalik/received_events","type":"User","site_admin":false},"body":"HRESULT_FROM_WIN32.","created_at":"2018-04-05T17:08:45Z","updated_at":"2018-04-05T17:09:22Z","html_url":"https://github.com/aspnet/IISIntegration/pull/752#discussion_r179534702","pull_request_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments/179534702"},"html":{"href":"https://github.com/aspnet/IISIntegration/pull/752#discussion_r179534702"},"pull_request":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752","id":179203266,"html_url":"https://github.com/aspnet/IISIntegration/pull/752","diff_url":"https://github.com/aspnet/IISIntegration/pull/752.diff","patch_url":"https://github.com/aspnet/IISIntegration/pull/752.patch","issue_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/752","number":752,"state":"open","locked":false,"title":"Explore usage of std::mutex and CHandle","user":{"login":"pakrym","id":1697911,"avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false},"body":"This is exploratory PR which tries to explore improving our error handling/resource management patterns in native code. Main goal is to lower entry level and modernize the codebase.\r\n\r\nBasic ideas:\r\n1. Use RAII when possible (std::mutex, CHandle are two examples used in this PR) - provides easier, less error prone resource management and greatly simplifies logic by allowing to just `return` out of methods instead of doing goto finalization section.\r\n2. Catch all exceptions on the border between shim and inprocess handler to prevent them from leaking up the stack.\r\n\r\nNext possible steps:\r\nUse exceptions for flowing HRESULTS - a lot of our methods just receive hresult check if it's failed and return it up the stack - this is exactly what exceptions are created for.\r\n\r\nEasier to review with ?w=1 enabled:` https://github.com/aspnet/IISIntegration/pull/752?w=1`","created_at":"2018-04-03T19:57:03Z","updated_at":"2018-04-05T17:09:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22e13fe7515fa8b4184f48942eed31bb5837cf88","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pan-wang","id":18172635,"avatar_url":"https://avatars0.githubusercontent.com/u/18172635?v=4","gravatar_id":"","url":"https://api.github.com/users/pan-wang","html_url":"https://github.com/pan-wang","followers_url":"https://api.github.com/users/pan-wang/followers","following_url":"https://api.github.com/users/pan-wang/following{/other_user}","gists_url":"https://api.github.com/users/pan-wang/gists{/gist_id}","starred_url":"https://api.github.com/users/pan-wang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pan-wang/subscriptions","organizations_url":"https://api.github.com/users/pan-wang/orgs","repos_url":"https://api.github.com/users/pan-wang/repos","events_url":"https://api.github.com/users/pan-wang/events{/privacy}","received_events_url":"https://api.github.com/users/pan-wang/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752/commits","review_comments_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752/comments","review_comment_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/752/comments","statuses_url":"https://api.github.com/repos/aspnet/IISIntegration/statuses/8a5754f0d74bcf90b25bd333d899d7c95af120e2","head":{"label":"aspnet:pakrym/cpp2","ref":"pakrym/cpp2","sha":"8a5754f0d74bcf90b25bd333d899d7c95af120e2","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":42883699,"name":"IISIntegration","full_name":"aspnet/IISIntegration","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/IISIntegration","description":"ASP.NET Core IIS integration","fork":false,"url":"https://api.github.com/repos/aspnet/IISIntegration","forks_url":"https://api.github.com/repos/aspnet/IISIntegration/forks","keys_url":"https://api.github.com/repos/aspnet/IISIntegration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/IISIntegration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/IISIntegration/teams","hooks_url":"https://api.github.com/repos/aspnet/IISIntegration/hooks","issue_events_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/IISIntegration/events","assignees_url":"https://api.github.com/repos/aspnet/IISIntegration/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/IISIntegration/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/IISIntegration/tags","blobs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/IISIntegration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/IISIntegration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/IISIntegration/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/IISIntegration/languages","stargazers_url":"https://api.github.com/repos/aspnet/IISIntegration/stargazers","contributors_url":"https://api.github.com/repos/aspnet/IISIntegration/contributors","subscribers_url":"https://api.github.com/repos/aspnet/IISIntegration/subscribers","subscription_url":"https://api.github.com/repos/aspnet/IISIntegration/subscription","commits_url":"https://api.github.com/repos/aspnet/IISIntegration/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/IISIntegration/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/IISIntegration/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/IISIntegration/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/IISIntegration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/IISIntegration/merges","archive_url":"https://api.github.com/repos/aspnet/IISIntegration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/IISIntegration/downloads","issues_url":"https://api.github.com/repos/aspnet/IISIntegration/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/IISIntegration/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/IISIntegration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/IISIntegration/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/IISIntegration/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/IISIntegration/deployments","created_at":"2015-09-21T17:55:09Z","updated_at":"2018-04-04T21:24:46Z","pushed_at":"2018-04-04T21:24:44Z","git_url":"git://github.com/aspnet/IISIntegration.git","ssh_url":"git@github.com:aspnet/IISIntegration.git","clone_url":"https://github.com/aspnet/IISIntegration.git","svn_url":"https://github.com/aspnet/IISIntegration","homepage":"","size":3068,"stargazers_count":89,"watchers_count":89,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":75,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":40,"open_issues":75,"watchers":89,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"ce9ffaddad46ed29da714c9e7feb2df8c7c62d59","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":42883699,"name":"IISIntegration","full_name":"aspnet/IISIntegration","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars3.githubusercontent.com/u/6476660?v=4","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/IISIntegration","description":"ASP.NET Core IIS integration","fork":false,"url":"https://api.github.com/repos/aspnet/IISIntegration","forks_url":"https://api.github.com/repos/aspnet/IISIntegration/forks","keys_url":"https://api.github.com/repos/aspnet/IISIntegration/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/IISIntegration/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/IISIntegration/teams","hooks_url":"https://api.github.com/repos/aspnet/IISIntegration/hooks","issue_events_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/IISIntegration/events","assignees_url":"https://api.github.com/repos/aspnet/IISIntegration/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/IISIntegration/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/IISIntegration/tags","blobs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/IISIntegration/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/IISIntegration/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/IISIntegration/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/IISIntegration/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/IISIntegration/languages","stargazers_url":"https://api.github.com/repos/aspnet/IISIntegration/stargazers","contributors_url":"https://api.github.com/repos/aspnet/IISIntegration/contributors","subscribers_url":"https://api.github.com/repos/aspnet/IISIntegration/subscribers","subscription_url":"https://api.github.com/repos/aspnet/IISIntegration/subscription","commits_url":"https://api.github.com/repos/aspnet/IISIntegration/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/IISIntegration/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/IISIntegration/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/IISIntegration/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/IISIntegration/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/IISIntegration/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/IISIntegration/merges","archive_url":"https://api.github.com/repos/aspnet/IISIntegration/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/IISIntegration/downloads","issues_url":"https://api.github.com/repos/aspnet/IISIntegration/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/IISIntegration/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/IISIntegration/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/IISIntegration/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/IISIntegration/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/IISIntegration/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/IISIntegration/deployments","created_at":"2015-09-21T17:55:09Z","updated_at":"2018-04-04T21:24:46Z","pushed_at":"2018-04-04T21:24:44Z","git_url":"git://github.com/aspnet/IISIntegration.git","ssh_url":"git@github.com:aspnet/IISIntegration.git","clone_url":"https://github.com/aspnet/IISIntegration.git","svn_url":"https://github.com/aspnet/IISIntegration","homepage":"","size":3068,"stargazers_count":89,"watchers_count":89,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":75,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":40,"open_issues":75,"watchers":89,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752"},"html":{"href":"https://github.com/aspnet/IISIntegration/pull/752"},"issue":{"href":"https://api.github.com/repos/aspnet/IISIntegration/issues/752"},"comments":{"href":"https://api.github.com/repos/aspnet/IISIntegration/issues/752/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/IISIntegration/pulls/752/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/IISIntegration/statuses/8a5754f0d74bcf90b25bd333d899d7c95af120e2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jkotalik"}}