{"action":"created","comment":{"url":"https://api.github.com/repos/fastify/fastify/pulls/comments/228261416","pull_request_review_id":168494130,"id":228261416,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODI2MTQxNg==","diff_hunk":"@@ -197,7 +202,7 @@ function onSendHook (reply, payload) {\n \n function wrapOnSendEnd (err, request, reply, payload) {\n   if (err != null) {","path":"lib/reply.js","position":31,"original_position":31,"commit_id":"efaa11d0ff6340561a4632347cd51555a540fda4","original_commit_id":"6a7f9614e2f5c7c42b169a5c54c9d78bade1126b","user":{"login":"cemremengu","id":1297759,"node_id":"MDQ6VXNlcjEyOTc3NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/1297759?v=4","gravatar_id":"","url":"https://api.github.com/users/cemremengu","html_url":"https://github.com/cemremengu","followers_url":"https://api.github.com/users/cemremengu/followers","following_url":"https://api.github.com/users/cemremengu/following{/other_user}","gists_url":"https://api.github.com/users/cemremengu/gists{/gist_id}","starred_url":"https://api.github.com/users/cemremengu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cemremengu/subscriptions","organizations_url":"https://api.github.com/users/cemremengu/orgs","repos_url":"https://api.github.com/users/cemremengu/repos","events_url":"https://api.github.com/users/cemremengu/events{/privacy}","received_events_url":"https://api.github.com/users/cemremengu/received_events","type":"User","site_admin":false},"body":"I see, these are nice to know thanks! :)","created_at":"2018-10-25T17:17:19Z","updated_at":"2018-10-25T17:17:19Z","html_url":"https://github.com/fastify/fastify/pull/1236#discussion_r228261416","pull_request_url":"https://api.github.com/repos/fastify/fastify/pulls/1236","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify/pulls/comments/228261416"},"html":{"href":"https://github.com/fastify/fastify/pull/1236#discussion_r228261416"},"pull_request":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1236"}},"in_reply_to_id":228260069},"pull_request":{"url":"https://api.github.com/repos/fastify/fastify/pulls/1236","id":225833892,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1ODMzODky","html_url":"https://github.com/fastify/fastify/pull/1236","diff_url":"https://github.com/fastify/fastify/pull/1236.diff","patch_url":"https://github.com/fastify/fastify/pull/1236.patch","issue_url":"https://api.github.com/repos/fastify/fastify/issues/1236","number":1236,"state":"open","locked":false,"title":"WIP: onError hook","user":{"login":"delvedor","id":4865608,"node_id":"MDQ6VXNlcjQ4NjU2MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4865608?v=4","gravatar_id":"","url":"https://api.github.com/users/delvedor","html_url":"https://github.com/delvedor","followers_url":"https://api.github.com/users/delvedor/followers","following_url":"https://api.github.com/users/delvedor/following{/other_user}","gists_url":"https://api.github.com/users/delvedor/gists{/gist_id}","starred_url":"https://api.github.com/users/delvedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delvedor/subscriptions","organizations_url":"https://api.github.com/users/delvedor/orgs","repos_url":"https://api.github.com/users/delvedor/repos","events_url":"https://api.github.com/users/delvedor/events{/privacy}","received_events_url":"https://api.github.com/users/delvedor/received_events","type":"User","site_admin":false},"body":"Hi all!\r\nThis is an initial implementation of what discussed in https://github.com/fastify/fastify/issues/1224.\r\n\r\nThe documentation/typings are still missing, once we finalize the API and how it works, I'll add them.\r\n\r\nFeatures:\r\n- The `onError` hook lives inside the standard request pipeline and is executed every time `reply.send` is invoked with an Error object (but only after the `customErrorHandler` has finished its execution, in `next` we always have a default);\r\n- `reply.send` will throw if called inside the `onError` hook;\r\n- Changing headers is allowed.\r\n\r\nNote:\r\n- If you pass an error to the `next` function inside the `onError` hook, that error will be swallowed.\r\n\r\nFeedbacks are welcome!\r\n\r\ncc @watson \r\n\r\n#### Checklist\r\n\r\n- [x] run `npm run test` and `npm run benchmark`\r\n- [x] tests and/or benchmarks are included\r\n- [ ] documentation is changed or added\r\n- [x] commit message and code follows [Code of conduct](https://github.com/fastify/fastify/blob/master/CODE_OF_CONDUCT.md)\r\n","created_at":"2018-10-25T16:57:56Z","updated_at":"2018-10-25T17:17:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1734fc4c897181075313d20a5f1edf1c248ea8f8","assignee":{"login":"delvedor","id":4865608,"node_id":"MDQ6VXNlcjQ4NjU2MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4865608?v=4","gravatar_id":"","url":"https://api.github.com/users/delvedor","html_url":"https://github.com/delvedor","followers_url":"https://api.github.com/users/delvedor/followers","following_url":"https://api.github.com/users/delvedor/following{/other_user}","gists_url":"https://api.github.com/users/delvedor/gists{/gist_id}","starred_url":"https://api.github.com/users/delvedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delvedor/subscriptions","organizations_url":"https://api.github.com/users/delvedor/orgs","repos_url":"https://api.github.com/users/delvedor/repos","events_url":"https://api.github.com/users/delvedor/events{/privacy}","received_events_url":"https://api.github.com/users/delvedor/received_events","type":"User","site_admin":false},"assignees":[{"login":"delvedor","id":4865608,"node_id":"MDQ6VXNlcjQ4NjU2MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4865608?v=4","gravatar_id":"","url":"https://api.github.com/users/delvedor","html_url":"https://github.com/delvedor","followers_url":"https://api.github.com/users/delvedor/followers","following_url":"https://api.github.com/users/delvedor/following{/other_user}","gists_url":"https://api.github.com/users/delvedor/gists{/gist_id}","starred_url":"https://api.github.com/users/delvedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delvedor/subscriptions","organizations_url":"https://api.github.com/users/delvedor/orgs","repos_url":"https://api.github.com/users/delvedor/repos","events_url":"https://api.github.com/users/delvedor/events{/privacy}","received_events_url":"https://api.github.com/users/delvedor/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":688296164,"node_id":"MDU6TGFiZWw2ODgyOTYxNjQ=","url":"https://api.github.com/repos/fastify/fastify/labels/documentation","name":"documentation","color":"fef2c0","default":false},{"id":512976619,"node_id":"MDU6TGFiZWw1MTI5NzY2MTk=","url":"https://api.github.com/repos/fastify/fastify/labels/feature","name":"feature","color":"1d76db","default":false},{"id":764678145,"node_id":"MDU6TGFiZWw3NjQ2NzgxNDU=","url":"https://api.github.com/repos/fastify/fastify/labels/semver-major","name":"semver-major","color":"fbca04","default":false},{"id":772309804,"node_id":"MDU6TGFiZWw3NzIzMDk4MDQ=","url":"https://api.github.com/repos/fastify/fastify/labels/typescript","name":"typescript","color":"d4c5f9","default":false}],"milestone":{"url":"https://api.github.com/repos/fastify/fastify/milestones/2","html_url":"https://github.com/fastify/fastify/milestone/2","labels_url":"https://api.github.com/repos/fastify/fastify/milestones/2/labels","id":3418492,"node_id":"MDk6TWlsZXN0b25lMzQxODQ5Mg==","number":2,"title":"v2.0.0","description":"The next major release of Fastify.","creator":{"login":"delvedor","id":4865608,"node_id":"MDQ6VXNlcjQ4NjU2MDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4865608?v=4","gravatar_id":"","url":"https://api.github.com/users/delvedor","html_url":"https://github.com/delvedor","followers_url":"https://api.github.com/users/delvedor/followers","following_url":"https://api.github.com/users/delvedor/following{/other_user}","gists_url":"https://api.github.com/users/delvedor/gists{/gist_id}","starred_url":"https://api.github.com/users/delvedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delvedor/subscriptions","organizations_url":"https://api.github.com/users/delvedor/orgs","repos_url":"https://api.github.com/users/delvedor/repos","events_url":"https://api.github.com/users/delvedor/events{/privacy}","received_events_url":"https://api.github.com/users/delvedor/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":22,"state":"open","created_at":"2018-06-12T10:03:52Z","updated_at":"2018-10-25T17:05:59Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/fastify/fastify/pulls/1236/commits","review_comments_url":"https://api.github.com/repos/fastify/fastify/pulls/1236/comments","review_comment_url":"https://api.github.com/repos/fastify/fastify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastify/fastify/issues/1236/comments","statuses_url":"https://api.github.com/repos/fastify/fastify/statuses/efaa11d0ff6340561a4632347cd51555a540fda4","head":{"label":"fastify:on-error-hook","ref":"on-error-hook","sha":"efaa11d0ff6340561a4632347cd51555a540fda4","user":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"repo":{"id":69495170,"node_id":"MDEwOlJlcG9zaXRvcnk2OTQ5NTE3MA==","name":"fastify","full_name":"fastify/fastify","private":false,"owner":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/fastify/fastify","description":"Fast and low overhead web framework, for Node.js","fork":false,"url":"https://api.github.com/repos/fastify/fastify","forks_url":"https://api.github.com/repos/fastify/fastify/forks","keys_url":"https://api.github.com/repos/fastify/fastify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastify/fastify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastify/fastify/teams","hooks_url":"https://api.github.com/repos/fastify/fastify/hooks","issue_events_url":"https://api.github.com/repos/fastify/fastify/issues/events{/number}","events_url":"https://api.github.com/repos/fastify/fastify/events","assignees_url":"https://api.github.com/repos/fastify/fastify/assignees{/user}","branches_url":"https://api.github.com/repos/fastify/fastify/branches{/branch}","tags_url":"https://api.github.com/repos/fastify/fastify/tags","blobs_url":"https://api.github.com/repos/fastify/fastify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastify/fastify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastify/fastify/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastify/fastify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastify/fastify/statuses/{sha}","languages_url":"https://api.github.com/repos/fastify/fastify/languages","stargazers_url":"https://api.github.com/repos/fastify/fastify/stargazers","contributors_url":"https://api.github.com/repos/fastify/fastify/contributors","subscribers_url":"https://api.github.com/repos/fastify/fastify/subscribers","subscription_url":"https://api.github.com/repos/fastify/fastify/subscription","commits_url":"https://api.github.com/repos/fastify/fastify/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastify/fastify/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastify/fastify/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastify/fastify/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastify/fastify/contents/{+path}","compare_url":"https://api.github.com/repos/fastify/fastify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastify/fastify/merges","archive_url":"https://api.github.com/repos/fastify/fastify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastify/fastify/downloads","issues_url":"https://api.github.com/repos/fastify/fastify/issues{/number}","pulls_url":"https://api.github.com/repos/fastify/fastify/pulls{/number}","milestones_url":"https://api.github.com/repos/fastify/fastify/milestones{/number}","notifications_url":"https://api.github.com/repos/fastify/fastify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastify/fastify/labels{/name}","releases_url":"https://api.github.com/repos/fastify/fastify/releases{/id}","deployments_url":"https://api.github.com/repos/fastify/fastify/deployments","created_at":"2016-09-28T19:10:14Z","updated_at":"2018-10-25T17:12:46Z","pushed_at":"2018-10-25T17:12:53Z","git_url":"git://github.com/fastify/fastify.git","ssh_url":"git@github.com:fastify/fastify.git","clone_url":"https://github.com/fastify/fastify.git","svn_url":"https://github.com/fastify/fastify","homepage":"https://www.fastify.io","size":1845,"stargazers_count":8460,"watchers_count":8460,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":469,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":469,"open_issues":33,"watchers":8460,"default_branch":"master"}},"base":{"label":"fastify:next","ref":"next","sha":"c11ed5a219a0fff6930c0ce3227fc2c2b97010a2","user":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"repo":{"id":69495170,"node_id":"MDEwOlJlcG9zaXRvcnk2OTQ5NTE3MA==","name":"fastify","full_name":"fastify/fastify","private":false,"owner":{"login":"fastify","id":24939410,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTM5NDEw","avatar_url":"https://avatars3.githubusercontent.com/u/24939410?v=4","gravatar_id":"","url":"https://api.github.com/users/fastify","html_url":"https://github.com/fastify","followers_url":"https://api.github.com/users/fastify/followers","following_url":"https://api.github.com/users/fastify/following{/other_user}","gists_url":"https://api.github.com/users/fastify/gists{/gist_id}","starred_url":"https://api.github.com/users/fastify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastify/subscriptions","organizations_url":"https://api.github.com/users/fastify/orgs","repos_url":"https://api.github.com/users/fastify/repos","events_url":"https://api.github.com/users/fastify/events{/privacy}","received_events_url":"https://api.github.com/users/fastify/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/fastify/fastify","description":"Fast and low overhead web framework, for Node.js","fork":false,"url":"https://api.github.com/repos/fastify/fastify","forks_url":"https://api.github.com/repos/fastify/fastify/forks","keys_url":"https://api.github.com/repos/fastify/fastify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastify/fastify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastify/fastify/teams","hooks_url":"https://api.github.com/repos/fastify/fastify/hooks","issue_events_url":"https://api.github.com/repos/fastify/fastify/issues/events{/number}","events_url":"https://api.github.com/repos/fastify/fastify/events","assignees_url":"https://api.github.com/repos/fastify/fastify/assignees{/user}","branches_url":"https://api.github.com/repos/fastify/fastify/branches{/branch}","tags_url":"https://api.github.com/repos/fastify/fastify/tags","blobs_url":"https://api.github.com/repos/fastify/fastify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastify/fastify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastify/fastify/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastify/fastify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastify/fastify/statuses/{sha}","languages_url":"https://api.github.com/repos/fastify/fastify/languages","stargazers_url":"https://api.github.com/repos/fastify/fastify/stargazers","contributors_url":"https://api.github.com/repos/fastify/fastify/contributors","subscribers_url":"https://api.github.com/repos/fastify/fastify/subscribers","subscription_url":"https://api.github.com/repos/fastify/fastify/subscription","commits_url":"https://api.github.com/repos/fastify/fastify/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastify/fastify/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastify/fastify/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastify/fastify/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastify/fastify/contents/{+path}","compare_url":"https://api.github.com/repos/fastify/fastify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastify/fastify/merges","archive_url":"https://api.github.com/repos/fastify/fastify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastify/fastify/downloads","issues_url":"https://api.github.com/repos/fastify/fastify/issues{/number}","pulls_url":"https://api.github.com/repos/fastify/fastify/pulls{/number}","milestones_url":"https://api.github.com/repos/fastify/fastify/milestones{/number}","notifications_url":"https://api.github.com/repos/fastify/fastify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastify/fastify/labels{/name}","releases_url":"https://api.github.com/repos/fastify/fastify/releases{/id}","deployments_url":"https://api.github.com/repos/fastify/fastify/deployments","created_at":"2016-09-28T19:10:14Z","updated_at":"2018-10-25T17:12:46Z","pushed_at":"2018-10-25T17:12:53Z","git_url":"git://github.com/fastify/fastify.git","ssh_url":"git@github.com:fastify/fastify.git","clone_url":"https://github.com/fastify/fastify.git","svn_url":"https://github.com/fastify/fastify","homepage":"https://www.fastify.io","size":1845,"stargazers_count":8460,"watchers_count":8460,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":469,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":469,"open_issues":33,"watchers":8460,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1236"},"html":{"href":"https://github.com/fastify/fastify/pull/1236"},"issue":{"href":"https://api.github.com/repos/fastify/fastify/issues/1236"},"comments":{"href":"https://api.github.com/repos/fastify/fastify/issues/1236/comments"},"review_comments":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1236/comments"},"review_comment":{"href":"https://api.github.com/repos/fastify/fastify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1236/commits"},"statuses":{"href":"https://api.github.com/repos/fastify/fastify/statuses/efaa11d0ff6340561a4632347cd51555a540fda4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"cemremengu"}}