{"action":"created","comment":{"url":"https://api.github.com/repos/fastify/fastify/pulls/comments/215079059","pull_request_review_id":152268592,"id":215079059,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTA3OTA1OQ==","diff_hunk":"@@ -177,8 +177,12 @@ fastify.get('/', function (request, reply) {\n   reply.send(httpErrors.Gone())\n })\n ```\n+By default Fastify will log the error depending on the `statusCode`:\n+- for `400 <= statusCode < 500` the error will be logged with level `info`\n+- for `statusCode >= 500` the error will be logged with level `error`","path":"docs/Reply.md","position":15,"original_position":15,"commit_id":"fc6d50a2145b186c467e13be3ea2bcf5f3b9baf3","original_commit_id":"fc6d50a2145b186c467e13be3ea2bcf5f3b9baf3","user":{"login":"allevo","id":1054125,"node_id":"MDQ6VXNlcjEwNTQxMjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1054125?v=4","gravatar_id":"","url":"https://api.github.com/users/allevo","html_url":"https://github.com/allevo","followers_url":"https://api.github.com/users/allevo/followers","following_url":"https://api.github.com/users/allevo/following{/other_user}","gists_url":"https://api.github.com/users/allevo/gists{/gist_id}","starred_url":"https://api.github.com/users/allevo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevo/subscriptions","organizations_url":"https://api.github.com/users/allevo/orgs","repos_url":"https://api.github.com/users/allevo/repos","events_url":"https://api.github.com/users/allevo/events{/privacy}","received_events_url":"https://api.github.com/users/allevo/received_events","type":"User","site_admin":false},"body":"Yeah, so the redirection is not performed even if the `statusCode` is set to 302.\r\n\r\nSo, I'd like to report this behavior in our doc. Maybe a 'All error with a `statusCode` property lower then 400 are treated as 500 ones' is sufficient.","created_at":"2018-09-04T21:54:00Z","updated_at":"2018-09-04T21:54:00Z","html_url":"https://github.com/fastify/fastify/pull/1135#discussion_r215079059","pull_request_url":"https://api.github.com/repos/fastify/fastify/pulls/1135","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify/pulls/comments/215079059"},"html":{"href":"https://github.com/fastify/fastify/pull/1135#discussion_r215079059"},"pull_request":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1135"}},"in_reply_to_id":215061921},"pull_request":{"url":"https://api.github.com/repos/fastify/fastify/pulls/1135","id":212985019,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyOTg1MDE5","html_url":"https://github.com/fastify/fastify/pull/1135","diff_url":"https://github.com/fastify/fastify/pull/1135.diff","patch_url":"https://github.com/fastify/fastify/pull/1135.patch","issue_url":"https://api.github.com/repos/fastify/fastify/issues/1135","number":1135,"state":"open","locked":false,"title":"Default error handler that logs the error","user":{"login":"mixecan","id":7155749,"node_id":"MDQ6VXNlcjcxNTU3NDk=","avatar_url":"https://avatars0.githubusercontent.com/u/7155749?v=4","gravatar_id":"","url":"https://api.github.com/users/mixecan","html_url":"https://github.com/mixecan","followers_url":"https://api.github.com/users/mixecan/followers","following_url":"https://api.github.com/users/mixecan/following{/other_user}","gists_url":"https://api.github.com/users/mixecan/gists{/gist_id}","starred_url":"https://api.github.com/users/mixecan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixecan/subscriptions","organizations_url":"https://api.github.com/users/mixecan/orgs","repos_url":"https://api.github.com/users/mixecan/repos","events_url":"https://api.github.com/users/mixecan/events{/privacy}","received_events_url":"https://api.github.com/users/mixecan/received_events","type":"User","site_admin":false},"body":"As discussed in #1119 this PR:\r\n- changes `reply.handlerError()` so that it logs an error only if no error handler is defined\r\n- renames customErrorHandler to errorHandler\r\n- updates the doc regarding the new behaviour, specifying that logging the error is in charge of the error handler, if specified\r\n\r\nThe log level depends on the `statusCode` as previous behaviour.\r\n\r\nOn my machine benchmarks improve by 10% with respect to `next`.\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- [x] 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-09-04T13:54:06Z","updated_at":"2018-09-04T21:54:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4505347333177f38c2400c89249bfbe927cc2243","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":747897137,"node_id":"MDU6TGFiZWw3NDc4OTcxMzc=","url":"https://api.github.com/repos/fastify/fastify/labels/breaking%20change","name":"breaking change","color":"d93f0b","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}],"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":4,"state":"open","created_at":"2018-06-12T10:03:52Z","updated_at":"2018-09-04T14:04:48Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/fastify/fastify/pulls/1135/commits","review_comments_url":"https://api.github.com/repos/fastify/fastify/pulls/1135/comments","review_comment_url":"https://api.github.com/repos/fastify/fastify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastify/fastify/issues/1135/comments","statuses_url":"https://api.github.com/repos/fastify/fastify/statuses/fc6d50a2145b186c467e13be3ea2bcf5f3b9baf3","head":{"label":"mixecan:default-error-handler","ref":"default-error-handler","sha":"fc6d50a2145b186c467e13be3ea2bcf5f3b9baf3","user":{"login":"mixecan","id":7155749,"node_id":"MDQ6VXNlcjcxNTU3NDk=","avatar_url":"https://avatars0.githubusercontent.com/u/7155749?v=4","gravatar_id":"","url":"https://api.github.com/users/mixecan","html_url":"https://github.com/mixecan","followers_url":"https://api.github.com/users/mixecan/followers","following_url":"https://api.github.com/users/mixecan/following{/other_user}","gists_url":"https://api.github.com/users/mixecan/gists{/gist_id}","starred_url":"https://api.github.com/users/mixecan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixecan/subscriptions","organizations_url":"https://api.github.com/users/mixecan/orgs","repos_url":"https://api.github.com/users/mixecan/repos","events_url":"https://api.github.com/users/mixecan/events{/privacy}","received_events_url":"https://api.github.com/users/mixecan/received_events","type":"User","site_admin":false},"repo":{"id":133487564,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM0ODc1NjQ=","name":"fastify","full_name":"mixecan/fastify","owner":{"login":"mixecan","id":7155749,"node_id":"MDQ6VXNlcjcxNTU3NDk=","avatar_url":"https://avatars0.githubusercontent.com/u/7155749?v=4","gravatar_id":"","url":"https://api.github.com/users/mixecan","html_url":"https://github.com/mixecan","followers_url":"https://api.github.com/users/mixecan/followers","following_url":"https://api.github.com/users/mixecan/following{/other_user}","gists_url":"https://api.github.com/users/mixecan/gists{/gist_id}","starred_url":"https://api.github.com/users/mixecan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixecan/subscriptions","organizations_url":"https://api.github.com/users/mixecan/orgs","repos_url":"https://api.github.com/users/mixecan/repos","events_url":"https://api.github.com/users/mixecan/events{/privacy}","received_events_url":"https://api.github.com/users/mixecan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mixecan/fastify","description":"Fast and low overhead web framework, for Node.js","fork":true,"url":"https://api.github.com/repos/mixecan/fastify","forks_url":"https://api.github.com/repos/mixecan/fastify/forks","keys_url":"https://api.github.com/repos/mixecan/fastify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixecan/fastify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixecan/fastify/teams","hooks_url":"https://api.github.com/repos/mixecan/fastify/hooks","issue_events_url":"https://api.github.com/repos/mixecan/fastify/issues/events{/number}","events_url":"https://api.github.com/repos/mixecan/fastify/events","assignees_url":"https://api.github.com/repos/mixecan/fastify/assignees{/user}","branches_url":"https://api.github.com/repos/mixecan/fastify/branches{/branch}","tags_url":"https://api.github.com/repos/mixecan/fastify/tags","blobs_url":"https://api.github.com/repos/mixecan/fastify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixecan/fastify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixecan/fastify/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixecan/fastify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixecan/fastify/statuses/{sha}","languages_url":"https://api.github.com/repos/mixecan/fastify/languages","stargazers_url":"https://api.github.com/repos/mixecan/fastify/stargazers","contributors_url":"https://api.github.com/repos/mixecan/fastify/contributors","subscribers_url":"https://api.github.com/repos/mixecan/fastify/subscribers","subscription_url":"https://api.github.com/repos/mixecan/fastify/subscription","commits_url":"https://api.github.com/repos/mixecan/fastify/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixecan/fastify/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixecan/fastify/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixecan/fastify/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixecan/fastify/contents/{+path}","compare_url":"https://api.github.com/repos/mixecan/fastify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixecan/fastify/merges","archive_url":"https://api.github.com/repos/mixecan/fastify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixecan/fastify/downloads","issues_url":"https://api.github.com/repos/mixecan/fastify/issues{/number}","pulls_url":"https://api.github.com/repos/mixecan/fastify/pulls{/number}","milestones_url":"https://api.github.com/repos/mixecan/fastify/milestones{/number}","notifications_url":"https://api.github.com/repos/mixecan/fastify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixecan/fastify/labels{/name}","releases_url":"https://api.github.com/repos/mixecan/fastify/releases{/id}","deployments_url":"https://api.github.com/repos/mixecan/fastify/deployments","created_at":"2018-05-15T08:48:16Z","updated_at":"2018-09-01T21:52:16Z","pushed_at":"2018-09-04T14:23:44Z","git_url":"git://github.com/mixecan/fastify.git","ssh_url":"git@github.com:mixecan/fastify.git","clone_url":"https://github.com/mixecan/fastify.git","svn_url":"https://github.com/mixecan/fastify","homepage":"https://www.fastify.io","size":1709,"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":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastify:next","ref":"next","sha":"39225010c4a7681bcbd4d137463449677908ce6b","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","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},"private":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-09-04T21:34:42Z","pushed_at":"2018-09-04T20:28:33Z","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":1715,"stargazers_count":7931,"watchers_count":7931,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":427,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":427,"open_issues":35,"watchers":7931,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1135"},"html":{"href":"https://github.com/fastify/fastify/pull/1135"},"issue":{"href":"https://api.github.com/repos/fastify/fastify/issues/1135"},"comments":{"href":"https://api.github.com/repos/fastify/fastify/issues/1135/comments"},"review_comments":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1135/comments"},"review_comment":{"href":"https://api.github.com/repos/fastify/fastify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastify/fastify/pulls/1135/commits"},"statuses":{"href":"https://api.github.com/repos/fastify/fastify/statuses/fc6d50a2145b186c467e13be3ea2bcf5f3b9baf3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"allevo"}}