{"action":"created","comment":{"url":"https://api.github.com/repos/mondough/typhon/pulls/comments/38666061","id":38666061,"diff_hunk":"@@ -47,19 +47,23 @@ func (p *Error) StackString() string {\n \n // VerboseString returns the error message, stack trace and contexts\n func (p *Error) VerboseString() string {\n-\treturn fmt.Sprintf(\"%s\\nPublic context: %+v\\nPrivate context: %+v\\n%s\", p.Error(), p.PublicContext, p.PrivateContext, p.StackString())\n+\treturn fmt.Sprintf(\"%s\\nParams: %+v\\n%s\", p.Error(), p.Params, p.StackString())\n }\n \n // New creates a new error for you. Use this if you want to pass along a custom error code.\n // Otherwise use the handy shorthand factories below\n-func New(code int, message string, context ...map[string]string) *Error {\n-\treturn errorFactory(code, message, context...)\n+func New(code string, message string, params map[string]string) *Error {\n+\treturn errorFactory(code, message, params)\n }\n \n // Wrap takes any error interface and wraps it into an Error.\n // This is useful because an Error contains lots of useful goodies, like the stacktrace of the error.\n // NOTE: If `err` is already an `Error` the passed contexts will be ignored\n-func Wrap(err error, context ...map[string]string) *Error {\n+func Wrap(err error, params map[string]string) *Error {","path":"errors/errors.go","position":73,"original_position":73,"commit_id":"20922cb08ba7827e752f8d8acd8dde33af16b135","original_commit_id":"20922cb08ba7827e752f8d8acd8dde33af16b135","user":{"login":"domwong","id":1785178,"avatar_url":"https://avatars.githubusercontent.com/u/1785178?v=3","gravatar_id":"","url":"https://api.github.com/users/domwong","html_url":"https://github.com/domwong","followers_url":"https://api.github.com/users/domwong/followers","following_url":"https://api.github.com/users/domwong/following{/other_user}","gists_url":"https://api.github.com/users/domwong/gists{/gist_id}","starred_url":"https://api.github.com/users/domwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domwong/subscriptions","organizations_url":"https://api.github.com/users/domwong/orgs","repos_url":"https://api.github.com/users/domwong/repos","events_url":"https://api.github.com/users/domwong/events{/privacy}","received_events_url":"https://api.github.com/users/domwong/received_events","type":"User","site_admin":false},"body":"Indeed. Something like this illustrates the point http://play.golang.org/p/5aus8SlMdF\r\n\r\nI think returning error rather than Error is the recommendation (can't remember where I read that now)","created_at":"2015-09-03T16:30:49Z","updated_at":"2015-09-03T16:30:49Z","html_url":"https://github.com/mondough/typhon/pull/46#discussion_r38666061","pull_request_url":"https://api.github.com/repos/mondough/typhon/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/mondough/typhon/pulls/comments/38666061"},"html":{"href":"https://github.com/mondough/typhon/pull/46#discussion_r38666061"},"pull_request":{"href":"https://api.github.com/repos/mondough/typhon/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/mondough/typhon/pulls/46","id":44000213,"html_url":"https://github.com/mondough/typhon/pull/46","diff_url":"https://github.com/mondough/typhon/pull/46.diff","patch_url":"https://github.com/mondough/typhon/pull/46.patch","issue_url":"https://api.github.com/repos/mondough/typhon/issues/46","number":46,"state":"open","locked":false,"title":"Refactor terrors","user":{"login":"domwong","id":1785178,"avatar_url":"https://avatars.githubusercontent.com/u/1785178?v=3","gravatar_id":"","url":"https://api.github.com/users/domwong","html_url":"https://github.com/domwong","followers_url":"https://api.github.com/users/domwong/followers","following_url":"https://api.github.com/users/domwong/following{/other_user}","gists_url":"https://api.github.com/users/domwong/gists{/gist_id}","starred_url":"https://api.github.com/users/domwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domwong/subscriptions","organizations_url":"https://api.github.com/users/domwong/orgs","repos_url":"https://api.github.com/users/domwong/repos","events_url":"https://api.github.com/users/domwong/events{/privacy}","received_events_url":"https://api.github.com/users/domwong/received_events","type":"User","site_admin":false},"body":"Big refactor of errors. ***PLEASE DO NOT MERGE UNTIL MERCURY AND OTHER DEPENDENT PRS ARE ALSO READY BECAUSE THESE ARE BREAKING CHANGES***\r\n\r\nErrors now look like this\r\n\r\n```\r\ntype Error struct {\r\n\tCode        string            `json:\"code\"`\r\n\tMessage     string            `json:\"message\"`\r\n\tParams      map[string]string `json:\"params\"`\r\n\tStackFrames stack.Stack       `json:\"stack\"`\r\n}\r\n\r\n```\r\n\r\nMain changes:\r\n* `Code` is now a string, and expected to be a dotted code. This allows us to provide more context for errors.\r\n* `PublicContext` and `PrivateContext` are replaced with a single `Params` map. This paves the way to add `golang.org/x/net/context.Context` as service context.","created_at":"2015-09-02T14:44:15Z","updated_at":"2015-09-03T16:30:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d520e1e5205592bf3bebd01ed4cbf055e073d961","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mondough/typhon/pulls/46/commits","review_comments_url":"https://api.github.com/repos/mondough/typhon/pulls/46/comments","review_comment_url":"https://api.github.com/repos/mondough/typhon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mondough/typhon/issues/46/comments","statuses_url":"https://api.github.com/repos/mondough/typhon/statuses/20922cb08ba7827e752f8d8acd8dde33af16b135","head":{"label":"mondough:refactor","ref":"refactor","sha":"20922cb08ba7827e752f8d8acd8dde33af16b135","user":{"login":"mondough","id":11029372,"avatar_url":"https://avatars.githubusercontent.com/u/11029372?v=3","gravatar_id":"","url":"https://api.github.com/users/mondough","html_url":"https://github.com/mondough","followers_url":"https://api.github.com/users/mondough/followers","following_url":"https://api.github.com/users/mondough/following{/other_user}","gists_url":"https://api.github.com/users/mondough/gists{/gist_id}","starred_url":"https://api.github.com/users/mondough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mondough/subscriptions","organizations_url":"https://api.github.com/users/mondough/orgs","repos_url":"https://api.github.com/users/mondough/repos","events_url":"https://api.github.com/users/mondough/events{/privacy}","received_events_url":"https://api.github.com/users/mondough/received_events","type":"Organization","site_admin":false},"repo":{"id":30697332,"name":"typhon","full_name":"mondough/typhon","owner":{"login":"mondough","id":11029372,"avatar_url":"https://avatars.githubusercontent.com/u/11029372?v=3","gravatar_id":"","url":"https://api.github.com/users/mondough","html_url":"https://github.com/mondough","followers_url":"https://api.github.com/users/mondough/followers","following_url":"https://api.github.com/users/mondough/following{/other_user}","gists_url":"https://api.github.com/users/mondough/gists{/gist_id}","starred_url":"https://api.github.com/users/mondough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mondough/subscriptions","organizations_url":"https://api.github.com/users/mondough/orgs","repos_url":"https://api.github.com/users/mondough/repos","events_url":"https://api.github.com/users/mondough/events{/privacy}","received_events_url":"https://api.github.com/users/mondough/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mondough/typhon","description":"Go based RPC framework","fork":false,"url":"https://api.github.com/repos/mondough/typhon","forks_url":"https://api.github.com/repos/mondough/typhon/forks","keys_url":"https://api.github.com/repos/mondough/typhon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mondough/typhon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mondough/typhon/teams","hooks_url":"https://api.github.com/repos/mondough/typhon/hooks","issue_events_url":"https://api.github.com/repos/mondough/typhon/issues/events{/number}","events_url":"https://api.github.com/repos/mondough/typhon/events","assignees_url":"https://api.github.com/repos/mondough/typhon/assignees{/user}","branches_url":"https://api.github.com/repos/mondough/typhon/branches{/branch}","tags_url":"https://api.github.com/repos/mondough/typhon/tags","blobs_url":"https://api.github.com/repos/mondough/typhon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mondough/typhon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mondough/typhon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mondough/typhon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mondough/typhon/statuses/{sha}","languages_url":"https://api.github.com/repos/mondough/typhon/languages","stargazers_url":"https://api.github.com/repos/mondough/typhon/stargazers","contributors_url":"https://api.github.com/repos/mondough/typhon/contributors","subscribers_url":"https://api.github.com/repos/mondough/typhon/subscribers","subscription_url":"https://api.github.com/repos/mondough/typhon/subscription","commits_url":"https://api.github.com/repos/mondough/typhon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mondough/typhon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mondough/typhon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mondough/typhon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mondough/typhon/contents/{+path}","compare_url":"https://api.github.com/repos/mondough/typhon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mondough/typhon/merges","archive_url":"https://api.github.com/repos/mondough/typhon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mondough/typhon/downloads","issues_url":"https://api.github.com/repos/mondough/typhon/issues{/number}","pulls_url":"https://api.github.com/repos/mondough/typhon/pulls{/number}","milestones_url":"https://api.github.com/repos/mondough/typhon/milestones{/number}","notifications_url":"https://api.github.com/repos/mondough/typhon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mondough/typhon/labels{/name}","releases_url":"https://api.github.com/repos/mondough/typhon/releases{/id}","created_at":"2015-02-12T10:21:42Z","updated_at":"2015-09-03T09:10:59Z","pushed_at":"2015-09-03T15:45:08Z","git_url":"git://github.com/mondough/typhon.git","ssh_url":"git@github.com:mondough/typhon.git","clone_url":"https://github.com/mondough/typhon.git","svn_url":"https://github.com/mondough/typhon","homepage":"","size":910,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":8,"default_branch":"master"}},"base":{"label":"mondough:master","ref":"master","sha":"6711f47faaefb53a9df4fb4bea4102f6db567a57","user":{"login":"mondough","id":11029372,"avatar_url":"https://avatars.githubusercontent.com/u/11029372?v=3","gravatar_id":"","url":"https://api.github.com/users/mondough","html_url":"https://github.com/mondough","followers_url":"https://api.github.com/users/mondough/followers","following_url":"https://api.github.com/users/mondough/following{/other_user}","gists_url":"https://api.github.com/users/mondough/gists{/gist_id}","starred_url":"https://api.github.com/users/mondough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mondough/subscriptions","organizations_url":"https://api.github.com/users/mondough/orgs","repos_url":"https://api.github.com/users/mondough/repos","events_url":"https://api.github.com/users/mondough/events{/privacy}","received_events_url":"https://api.github.com/users/mondough/received_events","type":"Organization","site_admin":false},"repo":{"id":30697332,"name":"typhon","full_name":"mondough/typhon","owner":{"login":"mondough","id":11029372,"avatar_url":"https://avatars.githubusercontent.com/u/11029372?v=3","gravatar_id":"","url":"https://api.github.com/users/mondough","html_url":"https://github.com/mondough","followers_url":"https://api.github.com/users/mondough/followers","following_url":"https://api.github.com/users/mondough/following{/other_user}","gists_url":"https://api.github.com/users/mondough/gists{/gist_id}","starred_url":"https://api.github.com/users/mondough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mondough/subscriptions","organizations_url":"https://api.github.com/users/mondough/orgs","repos_url":"https://api.github.com/users/mondough/repos","events_url":"https://api.github.com/users/mondough/events{/privacy}","received_events_url":"https://api.github.com/users/mondough/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mondough/typhon","description":"Go based RPC framework","fork":false,"url":"https://api.github.com/repos/mondough/typhon","forks_url":"https://api.github.com/repos/mondough/typhon/forks","keys_url":"https://api.github.com/repos/mondough/typhon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mondough/typhon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mondough/typhon/teams","hooks_url":"https://api.github.com/repos/mondough/typhon/hooks","issue_events_url":"https://api.github.com/repos/mondough/typhon/issues/events{/number}","events_url":"https://api.github.com/repos/mondough/typhon/events","assignees_url":"https://api.github.com/repos/mondough/typhon/assignees{/user}","branches_url":"https://api.github.com/repos/mondough/typhon/branches{/branch}","tags_url":"https://api.github.com/repos/mondough/typhon/tags","blobs_url":"https://api.github.com/repos/mondough/typhon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mondough/typhon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mondough/typhon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mondough/typhon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mondough/typhon/statuses/{sha}","languages_url":"https://api.github.com/repos/mondough/typhon/languages","stargazers_url":"https://api.github.com/repos/mondough/typhon/stargazers","contributors_url":"https://api.github.com/repos/mondough/typhon/contributors","subscribers_url":"https://api.github.com/repos/mondough/typhon/subscribers","subscription_url":"https://api.github.com/repos/mondough/typhon/subscription","commits_url":"https://api.github.com/repos/mondough/typhon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mondough/typhon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mondough/typhon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mondough/typhon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mondough/typhon/contents/{+path}","compare_url":"https://api.github.com/repos/mondough/typhon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mondough/typhon/merges","archive_url":"https://api.github.com/repos/mondough/typhon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mondough/typhon/downloads","issues_url":"https://api.github.com/repos/mondough/typhon/issues{/number}","pulls_url":"https://api.github.com/repos/mondough/typhon/pulls{/number}","milestones_url":"https://api.github.com/repos/mondough/typhon/milestones{/number}","notifications_url":"https://api.github.com/repos/mondough/typhon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mondough/typhon/labels{/name}","releases_url":"https://api.github.com/repos/mondough/typhon/releases{/id}","created_at":"2015-02-12T10:21:42Z","updated_at":"2015-09-03T09:10:59Z","pushed_at":"2015-09-03T15:45:08Z","git_url":"git://github.com/mondough/typhon.git","ssh_url":"git@github.com:mondough/typhon.git","clone_url":"https://github.com/mondough/typhon.git","svn_url":"https://github.com/mondough/typhon","homepage":"","size":910,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mondough/typhon/pulls/46"},"html":{"href":"https://github.com/mondough/typhon/pull/46"},"issue":{"href":"https://api.github.com/repos/mondough/typhon/issues/46"},"comments":{"href":"https://api.github.com/repos/mondough/typhon/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/mondough/typhon/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/mondough/typhon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mondough/typhon/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/mondough/typhon/statuses/20922cb08ba7827e752f8d8acd8dde33af16b135"}}}}