{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/expressjs.com/issues/805","repository_url":"https://api.github.com/repos/expressjs/expressjs.com","labels_url":"https://api.github.com/repos/expressjs/expressjs.com/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/expressjs.com/issues/805/comments","events_url":"https://api.github.com/repos/expressjs/expressjs.com/issues/805/events","html_url":"https://github.com/expressjs/expressjs.com/issues/805","id":226521211,"number":805,"title":"res-sendStatus.md -> res.sendStatus(2000), here 2000 is invalid.","user":{"login":"llwslc","id":5865414,"avatar_url":"https://avatars2.githubusercontent.com/u/5865414?v=3","gravatar_id":"","url":"https://api.github.com/users/llwslc","html_url":"https://github.com/llwslc","followers_url":"https://api.github.com/users/llwslc/followers","following_url":"https://api.github.com/users/llwslc/following{/other_user}","gists_url":"https://api.github.com/users/llwslc/gists{/gist_id}","starred_url":"https://api.github.com/users/llwslc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llwslc/subscriptions","organizations_url":"https://api.github.com/users/llwslc/orgs","repos_url":"https://api.github.com/users/llwslc/repos","events_url":"https://api.github.com/users/llwslc/events{/privacy}","received_events_url":"https://api.github.com/users/llwslc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-05-05T09:38:17Z","updated_at":"2017-05-09T19:34:24Z","closed_at":null,"body":"node code:\r\nhttps://github.com/nodejs/node/blob/e0a9ad1af244f8756a228a6d087b3a55ee4c0d14/lib/_http_server.js\r\n\r\n```\r\nif (statusCode < 100 || statusCode > 999)\r\n    throw new RangeError(`Invalid status code: ${originalStatusCode}`);\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/expressjs/expressjs.com/issues/comments/300277385","html_url":"https://github.com/expressjs/expressjs.com/issues/805#issuecomment-300277385","issue_url":"https://api.github.com/repos/expressjs/expressjs.com/issues/805","id":300277385,"user":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars0.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2017-05-09T19:34:24Z","updated_at":"2017-05-09T19:34:24Z","body":"@llwslc any error you throw within a handler ends up going through the error handling middleware. The fact that it comes through as a 500 is an implied behavior from the throw statement, it is not somehow specific to this `res.sendStatus` in any way. You can see this with the following:\r\n```js\r\nconst app = require('express')();\r\n\r\napp.use(function (err, req, res, next) {\r\n  // not work\r\n  res.status(888).send('Something broke!')\r\n})\r\n\r\napp.get('/', function (req, res)\r\n{\r\n  throw new Error('oh no!!');\r\n});\r\n\r\napp.listen(28888, function ()\r\n{\r\n  console.log(`Express started...`);\r\n});\r\n```"}}
{"actor":{"display_login":"dougwilson"}}