{"action":"created","comment":{"url":"https://api.github.com/repos/ViacomInc/data-point/pulls/comments/170384196","pull_request_review_id":99072168,"id":170384196,"diff_hunk":"@@ -96,41 +96,33 @@ function inspect (acc) {\n module.exports.inspect = inspect\n \n /**\n- * @param {Accumulator} acc\n+ * @param {Object} options\n+ * @return {Promise}\n+ */\n+function _requestReducer (options) {\n+  return rp(options)\n+}\n+\n+// this name will appear in the stack trace when a request fails\n+Object.defineProperty(_requestReducer, 'name', {\n+  value: 'request-promise#request'\n+})\n+\n+// this function is a reducer so that we can generate\n+// reducer stack traces if the request has an error\n+const requestReducer = createReducer(_requestReducer)\n+\n+module.exports.requestReducer = requestReducer\n+\n+/**\n+ * @param {Accumulator} accumulator\n  * @param {Function} resolveReducer\n  * @return {Promise<Accumulator>}\n  */\n-function resolveRequest (acc, resolveReducer) {\n-  inspect(acc)\n-  return rp(acc.options)\n-    .then(result => utils.set(acc, 'value', result))\n-    .catch(error => {\n-      // remove auth objects from acc and error for printing to console\n-      const redactedAcc = fp.set('options.auth', '[omitted]', acc)\n-      const redactedError = fp.set('options.auth', '[omitted]', error)\n-\n-      const message = [\n-        'Entity info:',\n-        '\\n  - Id: ',\n-        _.get(redactedAcc, 'reducer.spec.id'),\n-        '\\n',\n-        utils.inspectProperties(\n-          redactedAcc,\n-          ['options', 'params', 'value'],\n-          '  '\n-        ),\n-        '\\n  Request:\\n',\n-        utils.inspectProperties(\n-          redactedError,\n-          ['error', 'message', 'statusCode', 'options', 'body'],\n-          '  '\n-        )\n-      ].join('')\n-\n-      // attaching to error so it can be exposed by a handler outside datapoint\n-      error.message = `${error.message}\\n\\n${message}`\n-      throw error\n-    })\n+function resolveRequest (accumulator, resolveReducer) {\n+  inspect(accumulator)\n+  const acc = utils.set(accumulator, 'value', accumulator.options)\n+  return resolveReducer(acc, requestReducer)","path":"packages/data-point/lib/entity-types/entity-request/resolve.js","position":81,"original_position":81,"commit_id":"fe941614a55c342a922704ea65e4f11ffd2391a0","original_commit_id":"fe941614a55c342a922704ea65e4f11ffd2391a0","user":{"login":"raingerber","id":3729628,"avatar_url":"https://avatars2.githubusercontent.com/u/3729628?v=4","gravatar_id":"","url":"https://api.github.com/users/raingerber","html_url":"https://github.com/raingerber","followers_url":"https://api.github.com/users/raingerber/followers","following_url":"https://api.github.com/users/raingerber/following{/other_user}","gists_url":"https://api.github.com/users/raingerber/gists{/gist_id}","starred_url":"https://api.github.com/users/raingerber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raingerber/subscriptions","organizations_url":"https://api.github.com/users/raingerber/orgs","repos_url":"https://api.github.com/users/raingerber/repos","events_url":"https://api.github.com/users/raingerber/events{/privacy}","received_events_url":"https://api.github.com/users/raingerber/received_events","type":"User","site_admin":false},"body":"This gets rid of all the custom properties that were added to the error object here. My reasoning for this change is that I'm now adding `error#_value` and `error#_stack` properties that have a lot of the same information, and most of the other properties are just repeating data that's already available in the original error. now that we're no longer doing `console.info` with the error message (#210), it seems less important to have this code.","created_at":"2018-02-23T22:28:35Z","updated_at":"2018-02-23T22:28:35Z","html_url":"https://github.com/ViacomInc/data-point/pull/230#discussion_r170384196","pull_request_url":"https://api.github.com/repos/ViacomInc/data-point/pulls/230","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ViacomInc/data-point/pulls/comments/170384196"},"html":{"href":"https://github.com/ViacomInc/data-point/pull/230#discussion_r170384196"},"pull_request":{"href":"https://api.github.com/repos/ViacomInc/data-point/pulls/230"}}},"pull_request":{"url":"https://api.github.com/repos/ViacomInc/data-point/pulls/230","id":171122096,"html_url":"https://github.com/ViacomInc/data-point/pull/230","diff_url":"https://github.com/ViacomInc/data-point/pull/230.diff","patch_url":"https://github.com/ViacomInc/data-point/pull/230.patch","issue_url":"https://api.github.com/repos/ViacomInc/data-point/issues/230","number":230,"state":"open","locked":false,"title":"feat(data-point): Add reducer stack when reducers throw errors","user":{"login":"raingerber","id":3729628,"avatar_url":"https://avatars2.githubusercontent.com/u/3729628?v=4","gravatar_id":"","url":"https://api.github.com/users/raingerber","html_url":"https://github.com/raingerber","followers_url":"https://api.github.com/users/raingerber/followers","following_url":"https://api.github.com/users/raingerber/following{/other_user}","gists_url":"https://api.github.com/users/raingerber/gists{/gist_id}","starred_url":"https://api.github.com/users/raingerber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raingerber/subscriptions","organizations_url":"https://api.github.com/users/raingerber/orgs","repos_url":"https://api.github.com/users/raingerber/repos","events_url":"https://api.github.com/users/raingerber/events{/privacy}","received_events_url":"https://api.github.com/users/raingerber/received_events","type":"User","site_admin":false},"body":"<!-- What changes are being made? (What feature/bug is being fixed here?) -->\r\n**What**: closes #149. I opened a previous PR for this issue, but that implementation was (probably) less efficient than this one.\r\n\r\n<!-- Why are these changes necessary? -->\r\n**Why**: Helps with debugging\r\n\r\n<!-- How were these changes implemented? -->\r\n**How**: Add `_stack` and `_value` properties to error objects. It doesn't log anything though - leaving that to the user.\r\n\r\n<!-- Have you done all of these things?  -->\r\n**Checklist**:\r\n<!-- add \"N/A\" to the end of each line that's irrelevant to your changes -->\r\n<!-- to check an item, place an \"x\" in the box like so: \"- [x] Documentation\" -->\r\n- [ ] Has Breaking changes\r\n- [x] Documentation\r\n- [x] Tests\r\n- [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->","created_at":"2018-02-23T21:36:49Z","updated_at":"2018-02-23T22:28:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa2eb3ea0f62d366bb81dd9cf296a6386e8cfe46","assignee":{"login":"raingerber","id":3729628,"avatar_url":"https://avatars2.githubusercontent.com/u/3729628?v=4","gravatar_id":"","url":"https://api.github.com/users/raingerber","html_url":"https://github.com/raingerber","followers_url":"https://api.github.com/users/raingerber/followers","following_url":"https://api.github.com/users/raingerber/following{/other_user}","gists_url":"https://api.github.com/users/raingerber/gists{/gist_id}","starred_url":"https://api.github.com/users/raingerber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raingerber/subscriptions","organizations_url":"https://api.github.com/users/raingerber/orgs","repos_url":"https://api.github.com/users/raingerber/repos","events_url":"https://api.github.com/users/raingerber/events{/privacy}","received_events_url":"https://api.github.com/users/raingerber/received_events","type":"User","site_admin":false},"assignees":[{"login":"raingerber","id":3729628,"avatar_url":"https://avatars2.githubusercontent.com/u/3729628?v=4","gravatar_id":"","url":"https://api.github.com/users/raingerber","html_url":"https://github.com/raingerber","followers_url":"https://api.github.com/users/raingerber/followers","following_url":"https://api.github.com/users/raingerber/following{/other_user}","gists_url":"https://api.github.com/users/raingerber/gists{/gist_id}","starred_url":"https://api.github.com/users/raingerber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raingerber/subscriptions","organizations_url":"https://api.github.com/users/raingerber/orgs","repos_url":"https://api.github.com/users/raingerber/repos","events_url":"https://api.github.com/users/raingerber/events{/privacy}","received_events_url":"https://api.github.com/users/raingerber/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ViacomInc/data-point/pulls/230/commits","review_comments_url":"https://api.github.com/repos/ViacomInc/data-point/pulls/230/comments","review_comment_url":"https://api.github.com/repos/ViacomInc/data-point/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ViacomInc/data-point/issues/230/comments","statuses_url":"https://api.github.com/repos/ViacomInc/data-point/statuses/fe941614a55c342a922704ea65e4f11ffd2391a0","head":{"label":"raingerber:reducer-stack-second-attempt","ref":"reducer-stack-second-attempt","sha":"fe941614a55c342a922704ea65e4f11ffd2391a0","user":{"login":"raingerber","id":3729628,"avatar_url":"https://avatars2.githubusercontent.com/u/3729628?v=4","gravatar_id":"","url":"https://api.github.com/users/raingerber","html_url":"https://github.com/raingerber","followers_url":"https://api.github.com/users/raingerber/followers","following_url":"https://api.github.com/users/raingerber/following{/other_user}","gists_url":"https://api.github.com/users/raingerber/gists{/gist_id}","starred_url":"https://api.github.com/users/raingerber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raingerber/subscriptions","organizations_url":"https://api.github.com/users/raingerber/orgs","repos_url":"https://api.github.com/users/raingerber/repos","events_url":"https://api.github.com/users/raingerber/events{/privacy}","received_events_url":"https://api.github.com/users/raingerber/received_events","type":"User","site_admin":false},"repo":{"id":113381868,"name":"data-point","full_name":"raingerber/data-point","owner":{"login":"raingerber","id":3729628,"avatar_url":"https://avatars2.githubusercontent.com/u/3729628?v=4","gravatar_id":"","url":"https://api.github.com/users/raingerber","html_url":"https://github.com/raingerber","followers_url":"https://api.github.com/users/raingerber/followers","following_url":"https://api.github.com/users/raingerber/following{/other_user}","gists_url":"https://api.github.com/users/raingerber/gists{/gist_id}","starred_url":"https://api.github.com/users/raingerber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raingerber/subscriptions","organizations_url":"https://api.github.com/users/raingerber/orgs","repos_url":"https://api.github.com/users/raingerber/repos","events_url":"https://api.github.com/users/raingerber/events{/privacy}","received_events_url":"https://api.github.com/users/raingerber/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/raingerber/data-point","description":"JavaScript Utility for collecting, processing and transforming data","fork":true,"url":"https://api.github.com/repos/raingerber/data-point","forks_url":"https://api.github.com/repos/raingerber/data-point/forks","keys_url":"https://api.github.com/repos/raingerber/data-point/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raingerber/data-point/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raingerber/data-point/teams","hooks_url":"https://api.github.com/repos/raingerber/data-point/hooks","issue_events_url":"https://api.github.com/repos/raingerber/data-point/issues/events{/number}","events_url":"https://api.github.com/repos/raingerber/data-point/events","assignees_url":"https://api.github.com/repos/raingerber/data-point/assignees{/user}","branches_url":"https://api.github.com/repos/raingerber/data-point/branches{/branch}","tags_url":"https://api.github.com/repos/raingerber/data-point/tags","blobs_url":"https://api.github.com/repos/raingerber/data-point/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raingerber/data-point/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raingerber/data-point/git/refs{/sha}","trees_url":"https://api.github.com/repos/raingerber/data-point/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raingerber/data-point/statuses/{sha}","languages_url":"https://api.github.com/repos/raingerber/data-point/languages","stargazers_url":"https://api.github.com/repos/raingerber/data-point/stargazers","contributors_url":"https://api.github.com/repos/raingerber/data-point/contributors","subscribers_url":"https://api.github.com/repos/raingerber/data-point/subscribers","subscription_url":"https://api.github.com/repos/raingerber/data-point/subscription","commits_url":"https://api.github.com/repos/raingerber/data-point/commits{/sha}","git_commits_url":"https://api.github.com/repos/raingerber/data-point/git/commits{/sha}","comments_url":"https://api.github.com/repos/raingerber/data-point/comments{/number}","issue_comment_url":"https://api.github.com/repos/raingerber/data-point/issues/comments{/number}","contents_url":"https://api.github.com/repos/raingerber/data-point/contents/{+path}","compare_url":"https://api.github.com/repos/raingerber/data-point/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raingerber/data-point/merges","archive_url":"https://api.github.com/repos/raingerber/data-point/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raingerber/data-point/downloads","issues_url":"https://api.github.com/repos/raingerber/data-point/issues{/number}","pulls_url":"https://api.github.com/repos/raingerber/data-point/pulls{/number}","milestones_url":"https://api.github.com/repos/raingerber/data-point/milestones{/number}","notifications_url":"https://api.github.com/repos/raingerber/data-point/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raingerber/data-point/labels{/name}","releases_url":"https://api.github.com/repos/raingerber/data-point/releases{/id}","deployments_url":"https://api.github.com/repos/raingerber/data-point/deployments","created_at":"2017-12-07T00:18:52Z","updated_at":"2017-12-07T00:18:54Z","pushed_at":"2018-02-23T22:25:53Z","git_url":"git://github.com/raingerber/data-point.git","ssh_url":"git@github.com:raingerber/data-point.git","clone_url":"https://github.com/raingerber/data-point.git","svn_url":"https://github.com/raingerber/data-point","homepage":"","size":1160,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ViacomInc:master","ref":"master","sha":"a5f4906efb3cf8725be5455e34ba79627f1d18f0","user":{"login":"ViacomInc","id":7592161,"avatar_url":"https://avatars3.githubusercontent.com/u/7592161?v=4","gravatar_id":"","url":"https://api.github.com/users/ViacomInc","html_url":"https://github.com/ViacomInc","followers_url":"https://api.github.com/users/ViacomInc/followers","following_url":"https://api.github.com/users/ViacomInc/following{/other_user}","gists_url":"https://api.github.com/users/ViacomInc/gists{/gist_id}","starred_url":"https://api.github.com/users/ViacomInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ViacomInc/subscriptions","organizations_url":"https://api.github.com/users/ViacomInc/orgs","repos_url":"https://api.github.com/users/ViacomInc/repos","events_url":"https://api.github.com/users/ViacomInc/events{/privacy}","received_events_url":"https://api.github.com/users/ViacomInc/received_events","type":"Organization","site_admin":false},"repo":{"id":104899694,"name":"data-point","full_name":"ViacomInc/data-point","owner":{"login":"ViacomInc","id":7592161,"avatar_url":"https://avatars3.githubusercontent.com/u/7592161?v=4","gravatar_id":"","url":"https://api.github.com/users/ViacomInc","html_url":"https://github.com/ViacomInc","followers_url":"https://api.github.com/users/ViacomInc/followers","following_url":"https://api.github.com/users/ViacomInc/following{/other_user}","gists_url":"https://api.github.com/users/ViacomInc/gists{/gist_id}","starred_url":"https://api.github.com/users/ViacomInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ViacomInc/subscriptions","organizations_url":"https://api.github.com/users/ViacomInc/orgs","repos_url":"https://api.github.com/users/ViacomInc/repos","events_url":"https://api.github.com/users/ViacomInc/events{/privacy}","received_events_url":"https://api.github.com/users/ViacomInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ViacomInc/data-point","description":"JavaScript Utility for collecting, processing and transforming data","fork":false,"url":"https://api.github.com/repos/ViacomInc/data-point","forks_url":"https://api.github.com/repos/ViacomInc/data-point/forks","keys_url":"https://api.github.com/repos/ViacomInc/data-point/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ViacomInc/data-point/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ViacomInc/data-point/teams","hooks_url":"https://api.github.com/repos/ViacomInc/data-point/hooks","issue_events_url":"https://api.github.com/repos/ViacomInc/data-point/issues/events{/number}","events_url":"https://api.github.com/repos/ViacomInc/data-point/events","assignees_url":"https://api.github.com/repos/ViacomInc/data-point/assignees{/user}","branches_url":"https://api.github.com/repos/ViacomInc/data-point/branches{/branch}","tags_url":"https://api.github.com/repos/ViacomInc/data-point/tags","blobs_url":"https://api.github.com/repos/ViacomInc/data-point/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ViacomInc/data-point/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ViacomInc/data-point/git/refs{/sha}","trees_url":"https://api.github.com/repos/ViacomInc/data-point/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ViacomInc/data-point/statuses/{sha}","languages_url":"https://api.github.com/repos/ViacomInc/data-point/languages","stargazers_url":"https://api.github.com/repos/ViacomInc/data-point/stargazers","contributors_url":"https://api.github.com/repos/ViacomInc/data-point/contributors","subscribers_url":"https://api.github.com/repos/ViacomInc/data-point/subscribers","subscription_url":"https://api.github.com/repos/ViacomInc/data-point/subscription","commits_url":"https://api.github.com/repos/ViacomInc/data-point/commits{/sha}","git_commits_url":"https://api.github.com/repos/ViacomInc/data-point/git/commits{/sha}","comments_url":"https://api.github.com/repos/ViacomInc/data-point/comments{/number}","issue_comment_url":"https://api.github.com/repos/ViacomInc/data-point/issues/comments{/number}","contents_url":"https://api.github.com/repos/ViacomInc/data-point/contents/{+path}","compare_url":"https://api.github.com/repos/ViacomInc/data-point/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ViacomInc/data-point/merges","archive_url":"https://api.github.com/repos/ViacomInc/data-point/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ViacomInc/data-point/downloads","issues_url":"https://api.github.com/repos/ViacomInc/data-point/issues{/number}","pulls_url":"https://api.github.com/repos/ViacomInc/data-point/pulls{/number}","milestones_url":"https://api.github.com/repos/ViacomInc/data-point/milestones{/number}","notifications_url":"https://api.github.com/repos/ViacomInc/data-point/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ViacomInc/data-point/labels{/name}","releases_url":"https://api.github.com/repos/ViacomInc/data-point/releases{/id}","deployments_url":"https://api.github.com/repos/ViacomInc/data-point/deployments","created_at":"2017-09-26T15:01:41Z","updated_at":"2018-02-23T17:37:54Z","pushed_at":"2018-02-23T22:25:55Z","git_url":"git://github.com/ViacomInc/data-point.git","ssh_url":"git@github.com:ViacomInc/data-point.git","clone_url":"https://github.com/ViacomInc/data-point.git","svn_url":"https://github.com/ViacomInc/data-point","homepage":"","size":893,"stargazers_count":29,"watchers_count":29,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":15,"open_issues":26,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ViacomInc/data-point/pulls/230"},"html":{"href":"https://github.com/ViacomInc/data-point/pull/230"},"issue":{"href":"https://api.github.com/repos/ViacomInc/data-point/issues/230"},"comments":{"href":"https://api.github.com/repos/ViacomInc/data-point/issues/230/comments"},"review_comments":{"href":"https://api.github.com/repos/ViacomInc/data-point/pulls/230/comments"},"review_comment":{"href":"https://api.github.com/repos/ViacomInc/data-point/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ViacomInc/data-point/pulls/230/commits"},"statuses":{"href":"https://api.github.com/repos/ViacomInc/data-point/statuses/fe941614a55c342a922704ea65e4f11ffd2391a0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"raingerber"}}