{"action":"created","comment":{"url":"https://api.github.com/repos/almighty/almighty-core/pulls/comments/122387568","pull_request_review_id":44499057,"id":122387568,"diff_hunk":"@@ -196,15 +197,15 @@ func CreateResource(ctx context.Context, resource KeycloakResource, authzEndpoin\n \t\t\t\"resource\": resource,\n \t\t\t\"err\":      err.Error(),\n \t\t}, \"Unable to marshal keyclaok resource struct\")\n-\t\treturn \"\", errors.NewInternalError(\"unable to marshal keyclaok resource struct \" + err.Error())\n+\t\treturn \"\", errors.NewInternalError(errs.Wrap(err, \"unable to marshal keyclaok resource struct\"))\n \t}\n \n \treq, err := http.NewRequest(\"POST\", authzEndpoint, strings.NewReader(string(b)))\n \tif err != nil {\n \t\tlog.Error(ctx, map[string]interface{}{\n \t\t\t\"err\": err.Error(),\n \t\t}, \"Unable to crete http request\")\n-\t\treturn \"\", errors.NewInternalError(\"unable to crete http request \" + err.Error())\n+\t\treturn \"\", errors.NewInternalError(errs.Wrap(err, \"unable to crete http request\"))","path":"auth/authz.go","position":null,"original_position":22,"commit_id":"60047e1a37723bf50d96ad1f78f71ad8cbb03b57","original_commit_id":"dbdd21e23eb2980646db316913822523f1c768a7","user":{"login":"kwk","id":193408,"avatar_url":"https://avatars0.githubusercontent.com/u/193408?v=3","gravatar_id":"","url":"https://api.github.com/users/kwk","html_url":"https://github.com/kwk","followers_url":"https://api.github.com/users/kwk/followers","following_url":"https://api.github.com/users/kwk/following{/other_user}","gists_url":"https://api.github.com/users/kwk/gists{/gist_id}","starred_url":"https://api.github.com/users/kwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwk/subscriptions","organizations_url":"https://api.github.com/users/kwk/orgs","repos_url":"https://api.github.com/users/kwk/repos","events_url":"https://api.github.com/users/kwk/events{/privacy}","received_events_url":"https://api.github.com/users/kwk/received_events","type":"User","site_admin":false},"body":"Fixed in a1b9458f85b35530edb390941185794dfffe8322","created_at":"2017-06-16T08:14:48Z","updated_at":"2017-06-16T08:14:48Z","html_url":"https://github.com/almighty/almighty-core/pull/1404#discussion_r122387568","pull_request_url":"https://api.github.com/repos/almighty/almighty-core/pulls/1404","_links":{"self":{"href":"https://api.github.com/repos/almighty/almighty-core/pulls/comments/122387568"},"html":{"href":"https://github.com/almighty/almighty-core/pull/1404#discussion_r122387568"},"pull_request":{"href":"https://api.github.com/repos/almighty/almighty-core/pulls/1404"}}},"pull_request":{"url":"https://api.github.com/repos/almighty/almighty-core/pulls/1404","id":125909632,"html_url":"https://github.com/almighty/almighty-core/pull/1404","diff_url":"https://github.com/almighty/almighty-core/pull/1404.diff","patch_url":"https://github.com/almighty/almighty-core/pull/1404.patch","issue_url":"https://api.github.com/repos/almighty/almighty-core/issues/1404","number":1404,"state":"open","locked":false,"title":"Change internalservererror ctor","user":{"login":"kwk","id":193408,"avatar_url":"https://avatars0.githubusercontent.com/u/193408?v=3","gravatar_id":"","url":"https://api.github.com/users/kwk","html_url":"https://github.com/kwk","followers_url":"https://api.github.com/users/kwk/followers","following_url":"https://api.github.com/users/kwk/following{/other_user}","gists_url":"https://api.github.com/users/kwk/gists{/gist_id}","starred_url":"https://api.github.com/users/kwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwk/subscriptions","organizations_url":"https://api.github.com/users/kwk/orgs","repos_url":"https://api.github.com/users/kwk/repos","events_url":"https://api.github.com/users/kwk/events{/privacy}","received_events_url":"https://api.github.com/users/kwk/received_events","type":"User","site_admin":false},"body":"I've changed the constructor `NewInternalServerError` to accept an `error` object instead of a `string`. The short term benefit is two fold in the future:\r\n\r\n1. When somebody receives an `InternalServerError` she or he can inspect the cause of the error, e.g. by calling `errs.Cause(err)` (from the `github.com/pkg/errors` package) with the internal server error as the argument. This way we can find out if an internal server error was caused by postgres or is a path error and so forth.\r\n\r\n2. We can use the error argument to `NewInternalServerError` to log the error. In the code now we have many places where a `NewInternalServerError` is returned and immediately before we log the error. If we can make sure that all the information to the log message are included within the error we can later remove the log from all the various places and instead just do the log call on error creation.\r\n\r\nMaybe in the future we can make similar changes to the other errors as well. For now it is done just for the `InternalServerError`.","created_at":"2017-06-15T20:51:21Z","updated_at":"2017-06-16T08:14:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2737b890d87965c77138662800459e499d0d514","assignee":null,"assignees":[],"requested_reviewers":[{"login":"aslakknutsen","id":132158,"avatar_url":"https://avatars0.githubusercontent.com/u/132158?v=3","gravatar_id":"","url":"https://api.github.com/users/aslakknutsen","html_url":"https://github.com/aslakknutsen","followers_url":"https://api.github.com/users/aslakknutsen/followers","following_url":"https://api.github.com/users/aslakknutsen/following{/other_user}","gists_url":"https://api.github.com/users/aslakknutsen/gists{/gist_id}","starred_url":"https://api.github.com/users/aslakknutsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aslakknutsen/subscriptions","organizations_url":"https://api.github.com/users/aslakknutsen/orgs","repos_url":"https://api.github.com/users/aslakknutsen/repos","events_url":"https://api.github.com/users/aslakknutsen/events{/privacy}","received_events_url":"https://api.github.com/users/aslakknutsen/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/almighty/almighty-core/pulls/1404/commits","review_comments_url":"https://api.github.com/repos/almighty/almighty-core/pulls/1404/comments","review_comment_url":"https://api.github.com/repos/almighty/almighty-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/almighty/almighty-core/issues/1404/comments","statuses_url":"https://api.github.com/repos/almighty/almighty-core/statuses/60047e1a37723bf50d96ad1f78f71ad8cbb03b57","head":{"label":"kwk:change-internalservererror-ctor","ref":"change-internalservererror-ctor","sha":"60047e1a37723bf50d96ad1f78f71ad8cbb03b57","user":{"login":"kwk","id":193408,"avatar_url":"https://avatars0.githubusercontent.com/u/193408?v=3","gravatar_id":"","url":"https://api.github.com/users/kwk","html_url":"https://github.com/kwk","followers_url":"https://api.github.com/users/kwk/followers","following_url":"https://api.github.com/users/kwk/following{/other_user}","gists_url":"https://api.github.com/users/kwk/gists{/gist_id}","starred_url":"https://api.github.com/users/kwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwk/subscriptions","organizations_url":"https://api.github.com/users/kwk/orgs","repos_url":"https://api.github.com/users/kwk/repos","events_url":"https://api.github.com/users/kwk/events{/privacy}","received_events_url":"https://api.github.com/users/kwk/received_events","type":"User","site_admin":false},"repo":{"id":61216531,"name":"almighty-core","full_name":"kwk/almighty-core","owner":{"login":"kwk","id":193408,"avatar_url":"https://avatars0.githubusercontent.com/u/193408?v=3","gravatar_id":"","url":"https://api.github.com/users/kwk","html_url":"https://github.com/kwk","followers_url":"https://api.github.com/users/kwk/followers","following_url":"https://api.github.com/users/kwk/following{/other_user}","gists_url":"https://api.github.com/users/kwk/gists{/gist_id}","starred_url":"https://api.github.com/users/kwk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwk/subscriptions","organizations_url":"https://api.github.com/users/kwk/orgs","repos_url":"https://api.github.com/users/kwk/repos","events_url":"https://api.github.com/users/kwk/events{/privacy}","received_events_url":"https://api.github.com/users/kwk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kwk/almighty-core","description":null,"fork":true,"url":"https://api.github.com/repos/kwk/almighty-core","forks_url":"https://api.github.com/repos/kwk/almighty-core/forks","keys_url":"https://api.github.com/repos/kwk/almighty-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kwk/almighty-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kwk/almighty-core/teams","hooks_url":"https://api.github.com/repos/kwk/almighty-core/hooks","issue_events_url":"https://api.github.com/repos/kwk/almighty-core/issues/events{/number}","events_url":"https://api.github.com/repos/kwk/almighty-core/events","assignees_url":"https://api.github.com/repos/kwk/almighty-core/assignees{/user}","branches_url":"https://api.github.com/repos/kwk/almighty-core/branches{/branch}","tags_url":"https://api.github.com/repos/kwk/almighty-core/tags","blobs_url":"https://api.github.com/repos/kwk/almighty-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kwk/almighty-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kwk/almighty-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/kwk/almighty-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kwk/almighty-core/statuses/{sha}","languages_url":"https://api.github.com/repos/kwk/almighty-core/languages","stargazers_url":"https://api.github.com/repos/kwk/almighty-core/stargazers","contributors_url":"https://api.github.com/repos/kwk/almighty-core/contributors","subscribers_url":"https://api.github.com/repos/kwk/almighty-core/subscribers","subscription_url":"https://api.github.com/repos/kwk/almighty-core/subscription","commits_url":"https://api.github.com/repos/kwk/almighty-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/kwk/almighty-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/kwk/almighty-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/kwk/almighty-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/kwk/almighty-core/contents/{+path}","compare_url":"https://api.github.com/repos/kwk/almighty-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kwk/almighty-core/merges","archive_url":"https://api.github.com/repos/kwk/almighty-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kwk/almighty-core/downloads","issues_url":"https://api.github.com/repos/kwk/almighty-core/issues{/number}","pulls_url":"https://api.github.com/repos/kwk/almighty-core/pulls{/number}","milestones_url":"https://api.github.com/repos/kwk/almighty-core/milestones{/number}","notifications_url":"https://api.github.com/repos/kwk/almighty-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kwk/almighty-core/labels{/name}","releases_url":"https://api.github.com/repos/kwk/almighty-core/releases{/id}","deployments_url":"https://api.github.com/repos/kwk/almighty-core/deployments","created_at":"2016-06-15T14:55:29Z","updated_at":"2016-06-15T14:55:30Z","pushed_at":"2017-06-16T08:14:14Z","git_url":"git://github.com/kwk/almighty-core.git","ssh_url":"git@github.com:kwk/almighty-core.git","clone_url":"https://github.com/kwk/almighty-core.git","svn_url":"https://github.com/kwk/almighty-core","homepage":null,"size":4378,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"almighty:master","ref":"master","sha":"46051a98245f09c3fc172a7f6c7dd66fa313a518","user":{"login":"almighty","id":17783151,"avatar_url":"https://avatars2.githubusercontent.com/u/17783151?v=3","gravatar_id":"","url":"https://api.github.com/users/almighty","html_url":"https://github.com/almighty","followers_url":"https://api.github.com/users/almighty/followers","following_url":"https://api.github.com/users/almighty/following{/other_user}","gists_url":"https://api.github.com/users/almighty/gists{/gist_id}","starred_url":"https://api.github.com/users/almighty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almighty/subscriptions","organizations_url":"https://api.github.com/users/almighty/orgs","repos_url":"https://api.github.com/users/almighty/repos","events_url":"https://api.github.com/users/almighty/events{/privacy}","received_events_url":"https://api.github.com/users/almighty/received_events","type":"Organization","site_admin":false},"repo":{"id":54260706,"name":"almighty-core","full_name":"almighty/almighty-core","owner":{"login":"almighty","id":17783151,"avatar_url":"https://avatars2.githubusercontent.com/u/17783151?v=3","gravatar_id":"","url":"https://api.github.com/users/almighty","html_url":"https://github.com/almighty","followers_url":"https://api.github.com/users/almighty/followers","following_url":"https://api.github.com/users/almighty/following{/other_user}","gists_url":"https://api.github.com/users/almighty/gists{/gist_id}","starred_url":"https://api.github.com/users/almighty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almighty/subscriptions","organizations_url":"https://api.github.com/users/almighty/orgs","repos_url":"https://api.github.com/users/almighty/repos","events_url":"https://api.github.com/users/almighty/events{/privacy}","received_events_url":"https://api.github.com/users/almighty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/almighty/almighty-core","description":null,"fork":false,"url":"https://api.github.com/repos/almighty/almighty-core","forks_url":"https://api.github.com/repos/almighty/almighty-core/forks","keys_url":"https://api.github.com/repos/almighty/almighty-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/almighty/almighty-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/almighty/almighty-core/teams","hooks_url":"https://api.github.com/repos/almighty/almighty-core/hooks","issue_events_url":"https://api.github.com/repos/almighty/almighty-core/issues/events{/number}","events_url":"https://api.github.com/repos/almighty/almighty-core/events","assignees_url":"https://api.github.com/repos/almighty/almighty-core/assignees{/user}","branches_url":"https://api.github.com/repos/almighty/almighty-core/branches{/branch}","tags_url":"https://api.github.com/repos/almighty/almighty-core/tags","blobs_url":"https://api.github.com/repos/almighty/almighty-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/almighty/almighty-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/almighty/almighty-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/almighty/almighty-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/almighty/almighty-core/statuses/{sha}","languages_url":"https://api.github.com/repos/almighty/almighty-core/languages","stargazers_url":"https://api.github.com/repos/almighty/almighty-core/stargazers","contributors_url":"https://api.github.com/repos/almighty/almighty-core/contributors","subscribers_url":"https://api.github.com/repos/almighty/almighty-core/subscribers","subscription_url":"https://api.github.com/repos/almighty/almighty-core/subscription","commits_url":"https://api.github.com/repos/almighty/almighty-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/almighty/almighty-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/almighty/almighty-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/almighty/almighty-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/almighty/almighty-core/contents/{+path}","compare_url":"https://api.github.com/repos/almighty/almighty-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/almighty/almighty-core/merges","archive_url":"https://api.github.com/repos/almighty/almighty-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/almighty/almighty-core/downloads","issues_url":"https://api.github.com/repos/almighty/almighty-core/issues{/number}","pulls_url":"https://api.github.com/repos/almighty/almighty-core/pulls{/number}","milestones_url":"https://api.github.com/repos/almighty/almighty-core/milestones{/number}","notifications_url":"https://api.github.com/repos/almighty/almighty-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/almighty/almighty-core/labels{/name}","releases_url":"https://api.github.com/repos/almighty/almighty-core/releases{/id}","deployments_url":"https://api.github.com/repos/almighty/almighty-core/deployments","created_at":"2016-03-19T10:42:15Z","updated_at":"2017-05-24T06:46:35Z","pushed_at":"2017-06-16T08:14:15Z","git_url":"git://github.com/almighty/almighty-core.git","ssh_url":"git@github.com:almighty/almighty-core.git","clone_url":"https://github.com/almighty/almighty-core.git","svn_url":"https://github.com/almighty/almighty-core","homepage":"http://devdoc.almighty.io/","size":8102,"stargazers_count":27,"watchers_count":27,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":269,"forks":48,"open_issues":269,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/almighty/almighty-core/pulls/1404"},"html":{"href":"https://github.com/almighty/almighty-core/pull/1404"},"issue":{"href":"https://api.github.com/repos/almighty/almighty-core/issues/1404"},"comments":{"href":"https://api.github.com/repos/almighty/almighty-core/issues/1404/comments"},"review_comments":{"href":"https://api.github.com/repos/almighty/almighty-core/pulls/1404/comments"},"review_comment":{"href":"https://api.github.com/repos/almighty/almighty-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/almighty/almighty-core/pulls/1404/commits"},"statuses":{"href":"https://api.github.com/repos/almighty/almighty-core/statuses/60047e1a37723bf50d96ad1f78f71ad8cbb03b57"}}}}
{"actor":{"display_login":"kwk"}}