{"action":"created","comment":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/174416688","pull_request_review_id":103765353,"id":174416688,"diff_hunk":"@@ -61,17 +61,17 @@ let ip_of_pif (ref,record) =\n     }*)\n let assert_pif_prerequisites pif =\n   let assert_pif_permaplugged (ref,record) =\n-    if not record.API.pIF_disallow_unplug then failwith (Printf.sprintf \"PIF %s allows unplug\" record.API.pIF_uuid);\n-    if not record.pIF_currently_attached then failwith (Printf.sprintf \"PIF %s not plugged\" record.API.pIF_uuid)\n+    if not record.API.pIF_disallow_unplug then\n+      raise Api_errors.(Server_error (internal_error, [ \"PIF allows unplug\"; record.API.pIF_uuid ] ));\n+    if not record.pIF_currently_attached then\n+      raise Api_errors.(Server_error (required_pif_is_unplugged, [ record.API.pIF_uuid ] ))\n   in\n   assert_pif_permaplugged pif;\n   ignore(ip_of_pif pif)\n \n-let handle_error error =\n-  (* TODO: replace with API errors? *)\n-  match error with\n-  | InternalError message -> failwith (\"Internal Error: \" ^ message)\n-  | Unix_error message -> failwith (\"Unix Error: \" ^ message)\n+let handle_error = function\n+  | InternalError message -> raise Api_errors.(Server_error (internal_error, [ message ]))\n+  | Unix_error message -> raise Api_errors.(Server_error (internal_error, [ \"Unix Error: \" ^ message ]))","path":"ocaml/xapi/xapi_clustering.ml","position":21,"original_position":21,"commit_id":"c3d20614d6113d7fbbecafad786ccbe34f83680b","original_commit_id":"c3d20614d6113d7fbbecafad786ccbe34f83680b","user":{"login":"gaborigloi","id":10549240,"avatar_url":"https://avatars3.githubusercontent.com/u/10549240?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborigloi","html_url":"https://github.com/gaborigloi","followers_url":"https://api.github.com/users/gaborigloi/followers","following_url":"https://api.github.com/users/gaborigloi/following{/other_user}","gists_url":"https://api.github.com/users/gaborigloi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborigloi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborigloi/subscriptions","organizations_url":"https://api.github.com/users/gaborigloi/orgs","repos_url":"https://api.github.com/users/gaborigloi/repos","events_url":"https://api.github.com/users/gaborigloi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborigloi/received_events","type":"User","site_admin":false},"body":"Same as above.","created_at":"2018-03-14T10:41:50Z","updated_at":"2018-03-14T10:48:42Z","html_url":"https://github.com/xapi-project/xen-api/pull/3512#discussion_r174416688","pull_request_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/174416688"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/3512#discussion_r174416688"},"pull_request":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512"}}},"pull_request":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512","id":174911957,"html_url":"https://github.com/xapi-project/xen-api/pull/3512","diff_url":"https://github.com/xapi-project/xen-api/pull/3512.diff","patch_url":"https://github.com/xapi-project/xen-api/pull/3512.patch","issue_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3512","number":3512,"state":"open","locked":false,"title":"CA-285349: Add clustering errors, minor refactoring [REQ-477]","user":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"body":"- Replace some failures in Xapi_clustering with internal errors or API errors where possible\r\n- Introduce new API error for clustering\r\n- Refactor clustering assertion logic","created_at":"2018-03-14T10:31:36Z","updated_at":"2018-03-14T10:48:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94a5d4dd49ef52d5940349298a043be9834fe257","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512/commits","review_comments_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512/comments","review_comment_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3512/comments","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/c3d20614d6113d7fbbecafad786ccbe34f83680b","head":{"label":"minishrink:feature/REQ477/CA-285349/refactor_clustering","ref":"feature/REQ477/CA-285349/refactor_clustering","sha":"c3d20614d6113d7fbbecafad786ccbe34f83680b","user":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"repo":{"id":99582590,"name":"xen-api","full_name":"minishrink/xen-api","owner":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/minishrink/xen-api","description":"The Xapi Project's XenAPI Server","fork":true,"url":"https://api.github.com/repos/minishrink/xen-api","forks_url":"https://api.github.com/repos/minishrink/xen-api/forks","keys_url":"https://api.github.com/repos/minishrink/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minishrink/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minishrink/xen-api/teams","hooks_url":"https://api.github.com/repos/minishrink/xen-api/hooks","issue_events_url":"https://api.github.com/repos/minishrink/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/minishrink/xen-api/events","assignees_url":"https://api.github.com/repos/minishrink/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/minishrink/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/minishrink/xen-api/tags","blobs_url":"https://api.github.com/repos/minishrink/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minishrink/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minishrink/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/minishrink/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minishrink/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/minishrink/xen-api/languages","stargazers_url":"https://api.github.com/repos/minishrink/xen-api/stargazers","contributors_url":"https://api.github.com/repos/minishrink/xen-api/contributors","subscribers_url":"https://api.github.com/repos/minishrink/xen-api/subscribers","subscription_url":"https://api.github.com/repos/minishrink/xen-api/subscription","commits_url":"https://api.github.com/repos/minishrink/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/minishrink/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/minishrink/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/minishrink/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/minishrink/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/minishrink/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minishrink/xen-api/merges","archive_url":"https://api.github.com/repos/minishrink/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minishrink/xen-api/downloads","issues_url":"https://api.github.com/repos/minishrink/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/minishrink/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/minishrink/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/minishrink/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minishrink/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/minishrink/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/minishrink/xen-api/deployments","created_at":"2017-08-07T13:45:59Z","updated_at":"2017-08-07T13:46:04Z","pushed_at":"2018-03-14T10:29:53Z","git_url":"git://github.com/minishrink/xen-api.git","ssh_url":"git@github.com:minishrink/xen-api.git","clone_url":"https://github.com/minishrink/xen-api.git","svn_url":"https://github.com/minishrink/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":30351,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xapi-project:feature/REQ477/master","ref":"feature/REQ477/master","sha":"d088ba16dbba71eee364880209f2c0e0a3459269","user":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars3.githubusercontent.com/u/317268?v=4","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"repo":{"id":960233,"name":"xen-api","full_name":"xapi-project/xen-api","owner":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars3.githubusercontent.com/u/317268?v=4","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xapi-project/xen-api","description":"The Xapi Project's XenAPI Server","fork":false,"url":"https://api.github.com/repos/xapi-project/xen-api","forks_url":"https://api.github.com/repos/xapi-project/xen-api/forks","keys_url":"https://api.github.com/repos/xapi-project/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xapi-project/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xapi-project/xen-api/teams","hooks_url":"https://api.github.com/repos/xapi-project/xen-api/hooks","issue_events_url":"https://api.github.com/repos/xapi-project/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/xapi-project/xen-api/events","assignees_url":"https://api.github.com/repos/xapi-project/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/xapi-project/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/xapi-project/xen-api/tags","blobs_url":"https://api.github.com/repos/xapi-project/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xapi-project/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xapi-project/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/xapi-project/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/xapi-project/xen-api/languages","stargazers_url":"https://api.github.com/repos/xapi-project/xen-api/stargazers","contributors_url":"https://api.github.com/repos/xapi-project/xen-api/contributors","subscribers_url":"https://api.github.com/repos/xapi-project/xen-api/subscribers","subscription_url":"https://api.github.com/repos/xapi-project/xen-api/subscription","commits_url":"https://api.github.com/repos/xapi-project/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/xapi-project/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/xapi-project/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/xapi-project/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/xapi-project/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xapi-project/xen-api/merges","archive_url":"https://api.github.com/repos/xapi-project/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xapi-project/xen-api/downloads","issues_url":"https://api.github.com/repos/xapi-project/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/xapi-project/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/xapi-project/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/xapi-project/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xapi-project/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/xapi-project/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/xapi-project/xen-api/deployments","created_at":"2010-10-04T10:52:57Z","updated_at":"2018-03-14T02:27:31Z","pushed_at":"2018-03-14T10:31:37Z","git_url":"git://github.com/xapi-project/xen-api.git","ssh_url":"git@github.com:xapi-project/xen-api.git","clone_url":"https://github.com/xapi-project/xen-api.git","svn_url":"https://github.com/xapi-project/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":32317,"stargazers_count":254,"watchers_count":254,"language":"OCaml","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":203,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":203,"open_issues":15,"watchers":254,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/3512"},"issue":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/3512"},"comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/3512/comments"},"review_comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512/comments"},"review_comment":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3512/commits"},"statuses":{"href":"https://api.github.com/repos/xapi-project/xen-api/statuses/c3d20614d6113d7fbbecafad786ccbe34f83680b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gaborigloi"}}