{"action":"created","comment":{"url":"https://api.github.com/repos/HomesNZ/go-common/pulls/comments/149800631","pull_request_review_id":75254002,"id":149800631,"diff_hunk":"@@ -36,12 +37,17 @@ type bugsnagHook struct{}\n func (b bugsnagHook) Levels() []logrus.Level {\n \treturn []logrus.Level{\n \t\tlogrus.ErrorLevel,\n+\t\tlogrus.FatalLevel,\n \t\tlogrus.PanicLevel,\n-\t\tlogrus.WarnLevel,\n \t}\n }\n \n // Fire sends the logrus entry to bugsnag.\n func (b bugsnagHook) Fire(entry *logrus.Entry) error {\n-\treturn bugsnag.Notify(errors.New(entry.Message), entry.Data)\n+\terr, ok := entry.Data[logrus.ErrorKey].(error)\n+\tif !ok {\n+\t\terr = errors.New(entry.Message)\n+\t}\n+\tnotify := bugsnagErrors.New(err, 1)","path":"config/logger.go","position":25,"original_position":25,"commit_id":"a67a036e8b8190ec8fc7e09ad05d30e2b4303977","original_commit_id":"a67a036e8b8190ec8fc7e09ad05d30e2b4303977","user":{"login":"proglottis","id":74465,"avatar_url":"https://avatars3.githubusercontent.com/u/74465?v=4","gravatar_id":"","url":"https://api.github.com/users/proglottis","html_url":"https://github.com/proglottis","followers_url":"https://api.github.com/users/proglottis/followers","following_url":"https://api.github.com/users/proglottis/following{/other_user}","gists_url":"https://api.github.com/users/proglottis/gists{/gist_id}","starred_url":"https://api.github.com/users/proglottis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proglottis/subscriptions","organizations_url":"https://api.github.com/users/proglottis/orgs","repos_url":"https://api.github.com/users/proglottis/repos","events_url":"https://api.github.com/users/proglottis/events{/privacy}","received_events_url":"https://api.github.com/users/proglottis/received_events","type":"User","site_admin":false},"body":"It's how much stacktrace to skip (this method). In theory we could cut off logrus from the stacktrace - but it's a big unknown since we don't control the code. I think it'll be better to provide our own stacktraces in future\r\nhttps://godoc.org/github.com/bugsnag/bugsnag-go/errors#New","created_at":"2017-11-08T21:23:51Z","updated_at":"2017-11-08T21:23:51Z","html_url":"https://github.com/HomesNZ/go-common/pull/55#discussion_r149800631","pull_request_url":"https://api.github.com/repos/HomesNZ/go-common/pulls/55","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/HomesNZ/go-common/pulls/comments/149800631"},"html":{"href":"https://github.com/HomesNZ/go-common/pull/55#discussion_r149800631"},"pull_request":{"href":"https://api.github.com/repos/HomesNZ/go-common/pulls/55"}},"in_reply_to_id":149800024},"pull_request":{"url":"https://api.github.com/repos/HomesNZ/go-common/pulls/55","id":151498170,"html_url":"https://github.com/HomesNZ/go-common/pull/55","diff_url":"https://github.com/HomesNZ/go-common/pull/55.diff","patch_url":"https://github.com/HomesNZ/go-common/pull/55.patch","issue_url":"https://api.github.com/repos/HomesNZ/go-common/issues/55","number":55,"state":"open","locked":false,"title":"Allow sending actual errors to bugsnag through logrus","user":{"login":"proglottis","id":74465,"avatar_url":"https://avatars3.githubusercontent.com/u/74465?v=4","gravatar_id":"","url":"https://api.github.com/users/proglottis","html_url":"https://github.com/proglottis","followers_url":"https://api.github.com/users/proglottis/followers","following_url":"https://api.github.com/users/proglottis/following{/other_user}","gists_url":"https://api.github.com/users/proglottis/gists{/gist_id}","starred_url":"https://api.github.com/users/proglottis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proglottis/subscriptions","organizations_url":"https://api.github.com/users/proglottis/orgs","repos_url":"https://api.github.com/users/proglottis/repos","events_url":"https://api.github.com/users/proglottis/events{/privacy}","received_events_url":"https://api.github.com/users/proglottis/received_events","type":"User","site_admin":false},"body":"This allows us to use `.WithError(err)` to send an actual error to bugsnag. We should get into the habit of doing this from now on.\r\n\r\nEventually I would like to convert github.com/pkg/errors to bugsnag errors and have stracktraces point to where the error was created and not where it was logged.","created_at":"2017-11-08T21:19:25Z","updated_at":"2017-11-08T21:23:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d5d356d91369a9e774b523a004bce33c8558439","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/HomesNZ/go-common/pulls/55/commits","review_comments_url":"https://api.github.com/repos/HomesNZ/go-common/pulls/55/comments","review_comment_url":"https://api.github.com/repos/HomesNZ/go-common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HomesNZ/go-common/issues/55/comments","statuses_url":"https://api.github.com/repos/HomesNZ/go-common/statuses/a67a036e8b8190ec8fc7e09ad05d30e2b4303977","head":{"label":"HomesNZ:feature/bugsnag","ref":"feature/bugsnag","sha":"a67a036e8b8190ec8fc7e09ad05d30e2b4303977","user":{"login":"HomesNZ","id":13653667,"avatar_url":"https://avatars2.githubusercontent.com/u/13653667?v=4","gravatar_id":"","url":"https://api.github.com/users/HomesNZ","html_url":"https://github.com/HomesNZ","followers_url":"https://api.github.com/users/HomesNZ/followers","following_url":"https://api.github.com/users/HomesNZ/following{/other_user}","gists_url":"https://api.github.com/users/HomesNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/HomesNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HomesNZ/subscriptions","organizations_url":"https://api.github.com/users/HomesNZ/orgs","repos_url":"https://api.github.com/users/HomesNZ/repos","events_url":"https://api.github.com/users/HomesNZ/events{/privacy}","received_events_url":"https://api.github.com/users/HomesNZ/received_events","type":"Organization","site_admin":false},"repo":{"id":52748960,"name":"go-common","full_name":"HomesNZ/go-common","owner":{"login":"HomesNZ","id":13653667,"avatar_url":"https://avatars2.githubusercontent.com/u/13653667?v=4","gravatar_id":"","url":"https://api.github.com/users/HomesNZ","html_url":"https://github.com/HomesNZ","followers_url":"https://api.github.com/users/HomesNZ/followers","following_url":"https://api.github.com/users/HomesNZ/following{/other_user}","gists_url":"https://api.github.com/users/HomesNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/HomesNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HomesNZ/subscriptions","organizations_url":"https://api.github.com/users/HomesNZ/orgs","repos_url":"https://api.github.com/users/HomesNZ/repos","events_url":"https://api.github.com/users/HomesNZ/events{/privacy}","received_events_url":"https://api.github.com/users/HomesNZ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HomesNZ/go-common","description":null,"fork":false,"url":"https://api.github.com/repos/HomesNZ/go-common","forks_url":"https://api.github.com/repos/HomesNZ/go-common/forks","keys_url":"https://api.github.com/repos/HomesNZ/go-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HomesNZ/go-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HomesNZ/go-common/teams","hooks_url":"https://api.github.com/repos/HomesNZ/go-common/hooks","issue_events_url":"https://api.github.com/repos/HomesNZ/go-common/issues/events{/number}","events_url":"https://api.github.com/repos/HomesNZ/go-common/events","assignees_url":"https://api.github.com/repos/HomesNZ/go-common/assignees{/user}","branches_url":"https://api.github.com/repos/HomesNZ/go-common/branches{/branch}","tags_url":"https://api.github.com/repos/HomesNZ/go-common/tags","blobs_url":"https://api.github.com/repos/HomesNZ/go-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HomesNZ/go-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HomesNZ/go-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/HomesNZ/go-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HomesNZ/go-common/statuses/{sha}","languages_url":"https://api.github.com/repos/HomesNZ/go-common/languages","stargazers_url":"https://api.github.com/repos/HomesNZ/go-common/stargazers","contributors_url":"https://api.github.com/repos/HomesNZ/go-common/contributors","subscribers_url":"https://api.github.com/repos/HomesNZ/go-common/subscribers","subscription_url":"https://api.github.com/repos/HomesNZ/go-common/subscription","commits_url":"https://api.github.com/repos/HomesNZ/go-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/HomesNZ/go-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/HomesNZ/go-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/HomesNZ/go-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/HomesNZ/go-common/contents/{+path}","compare_url":"https://api.github.com/repos/HomesNZ/go-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HomesNZ/go-common/merges","archive_url":"https://api.github.com/repos/HomesNZ/go-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HomesNZ/go-common/downloads","issues_url":"https://api.github.com/repos/HomesNZ/go-common/issues{/number}","pulls_url":"https://api.github.com/repos/HomesNZ/go-common/pulls{/number}","milestones_url":"https://api.github.com/repos/HomesNZ/go-common/milestones{/number}","notifications_url":"https://api.github.com/repos/HomesNZ/go-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HomesNZ/go-common/labels{/name}","releases_url":"https://api.github.com/repos/HomesNZ/go-common/releases{/id}","deployments_url":"https://api.github.com/repos/HomesNZ/go-common/deployments","created_at":"2016-02-28T22:51:05Z","updated_at":"2017-08-03T20:57:25Z","pushed_at":"2017-11-08T21:19:26Z","git_url":"git://github.com/HomesNZ/go-common.git","ssh_url":"git@github.com:HomesNZ/go-common.git","clone_url":"https://github.com/HomesNZ/go-common.git","svn_url":"https://github.com/HomesNZ/go-common","homepage":null,"size":20564,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"HomesNZ:master","ref":"master","sha":"84c10b6ce60a04845041db2a314ed3bfcfacf433","user":{"login":"HomesNZ","id":13653667,"avatar_url":"https://avatars2.githubusercontent.com/u/13653667?v=4","gravatar_id":"","url":"https://api.github.com/users/HomesNZ","html_url":"https://github.com/HomesNZ","followers_url":"https://api.github.com/users/HomesNZ/followers","following_url":"https://api.github.com/users/HomesNZ/following{/other_user}","gists_url":"https://api.github.com/users/HomesNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/HomesNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HomesNZ/subscriptions","organizations_url":"https://api.github.com/users/HomesNZ/orgs","repos_url":"https://api.github.com/users/HomesNZ/repos","events_url":"https://api.github.com/users/HomesNZ/events{/privacy}","received_events_url":"https://api.github.com/users/HomesNZ/received_events","type":"Organization","site_admin":false},"repo":{"id":52748960,"name":"go-common","full_name":"HomesNZ/go-common","owner":{"login":"HomesNZ","id":13653667,"avatar_url":"https://avatars2.githubusercontent.com/u/13653667?v=4","gravatar_id":"","url":"https://api.github.com/users/HomesNZ","html_url":"https://github.com/HomesNZ","followers_url":"https://api.github.com/users/HomesNZ/followers","following_url":"https://api.github.com/users/HomesNZ/following{/other_user}","gists_url":"https://api.github.com/users/HomesNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/HomesNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HomesNZ/subscriptions","organizations_url":"https://api.github.com/users/HomesNZ/orgs","repos_url":"https://api.github.com/users/HomesNZ/repos","events_url":"https://api.github.com/users/HomesNZ/events{/privacy}","received_events_url":"https://api.github.com/users/HomesNZ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HomesNZ/go-common","description":null,"fork":false,"url":"https://api.github.com/repos/HomesNZ/go-common","forks_url":"https://api.github.com/repos/HomesNZ/go-common/forks","keys_url":"https://api.github.com/repos/HomesNZ/go-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HomesNZ/go-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HomesNZ/go-common/teams","hooks_url":"https://api.github.com/repos/HomesNZ/go-common/hooks","issue_events_url":"https://api.github.com/repos/HomesNZ/go-common/issues/events{/number}","events_url":"https://api.github.com/repos/HomesNZ/go-common/events","assignees_url":"https://api.github.com/repos/HomesNZ/go-common/assignees{/user}","branches_url":"https://api.github.com/repos/HomesNZ/go-common/branches{/branch}","tags_url":"https://api.github.com/repos/HomesNZ/go-common/tags","blobs_url":"https://api.github.com/repos/HomesNZ/go-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HomesNZ/go-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HomesNZ/go-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/HomesNZ/go-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HomesNZ/go-common/statuses/{sha}","languages_url":"https://api.github.com/repos/HomesNZ/go-common/languages","stargazers_url":"https://api.github.com/repos/HomesNZ/go-common/stargazers","contributors_url":"https://api.github.com/repos/HomesNZ/go-common/contributors","subscribers_url":"https://api.github.com/repos/HomesNZ/go-common/subscribers","subscription_url":"https://api.github.com/repos/HomesNZ/go-common/subscription","commits_url":"https://api.github.com/repos/HomesNZ/go-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/HomesNZ/go-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/HomesNZ/go-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/HomesNZ/go-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/HomesNZ/go-common/contents/{+path}","compare_url":"https://api.github.com/repos/HomesNZ/go-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HomesNZ/go-common/merges","archive_url":"https://api.github.com/repos/HomesNZ/go-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HomesNZ/go-common/downloads","issues_url":"https://api.github.com/repos/HomesNZ/go-common/issues{/number}","pulls_url":"https://api.github.com/repos/HomesNZ/go-common/pulls{/number}","milestones_url":"https://api.github.com/repos/HomesNZ/go-common/milestones{/number}","notifications_url":"https://api.github.com/repos/HomesNZ/go-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HomesNZ/go-common/labels{/name}","releases_url":"https://api.github.com/repos/HomesNZ/go-common/releases{/id}","deployments_url":"https://api.github.com/repos/HomesNZ/go-common/deployments","created_at":"2016-02-28T22:51:05Z","updated_at":"2017-08-03T20:57:25Z","pushed_at":"2017-11-08T21:19:26Z","git_url":"git://github.com/HomesNZ/go-common.git","ssh_url":"git@github.com:HomesNZ/go-common.git","clone_url":"https://github.com/HomesNZ/go-common.git","svn_url":"https://github.com/HomesNZ/go-common","homepage":null,"size":20564,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HomesNZ/go-common/pulls/55"},"html":{"href":"https://github.com/HomesNZ/go-common/pull/55"},"issue":{"href":"https://api.github.com/repos/HomesNZ/go-common/issues/55"},"comments":{"href":"https://api.github.com/repos/HomesNZ/go-common/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/HomesNZ/go-common/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/HomesNZ/go-common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HomesNZ/go-common/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/HomesNZ/go-common/statuses/a67a036e8b8190ec8fc7e09ad05d30e2b4303977"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"proglottis"}}