{"action":"created","issue":{"url":"https://api.github.com/repos/lukeed/polka/issues/68","repository_url":"https://api.github.com/repos/lukeed/polka","labels_url":"https://api.github.com/repos/lukeed/polka/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/lukeed/polka/issues/68/comments","events_url":"https://api.github.com/repos/lukeed/polka/issues/68/events","html_url":"https://github.com/lukeed/polka/issues/68","id":361658569,"node_id":"MDU6SXNzdWUzNjE2NTg1Njk=","number":68,"title":"Polka always running onError handler","user":{"login":"ansarizafar","id":5788284,"node_id":"MDQ6VXNlcjU3ODgyODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/5788284?v=4","gravatar_id":"","url":"https://api.github.com/users/ansarizafar","html_url":"https://github.com/ansarizafar","followers_url":"https://api.github.com/users/ansarizafar/followers","following_url":"https://api.github.com/users/ansarizafar/following{/other_user}","gists_url":"https://api.github.com/users/ansarizafar/gists{/gist_id}","starred_url":"https://api.github.com/users/ansarizafar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansarizafar/subscriptions","organizations_url":"https://api.github.com/users/ansarizafar/orgs","repos_url":"https://api.github.com/users/ansarizafar/repos","events_url":"https://api.github.com/users/ansarizafar/events{/privacy}","received_events_url":"https://api.github.com/users/ansarizafar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-19T09:29:31Z","updated_at":"2018-09-19T16:20:06Z","closed_at":null,"author_association":"NONE","body":"I am using polka v0..5.0 and here is my code \r\n````\r\nimport polka from 'polka';\r\n\r\nconst httpserver = polka({\r\n        onError: (e) => {\r\n          console.log('Error handling request');\r\n          console.log(e);\r\n           }\r\n      });\r\n httpserver.get('/', (req, res) => {\r\n      console.log('Request received');\r\n      res.end('Hello World!');\r\n    })\r\n httpserver.listen(3000, err => {\r\n   if(err) {\r\n    console.log(err);\r\n   }\r\n  })\r\n\r\n````\r\nWhen I access the route '/', I can see \"Request received\" in terminal and \"Hello world\" in browser but Polka is also running onError handler each time I access '/' route with error 404. Why polka is running onError handler even there is no un-handled exception in route handler.\r\n"},"comment":{"url":"https://api.github.com/repos/lukeed/polka/issues/comments/422866125","html_url":"https://github.com/lukeed/polka/issues/68#issuecomment-422866125","issue_url":"https://api.github.com/repos/lukeed/polka/issues/68","id":422866125,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjg2NjEyNQ==","user":{"login":"ansarizafar","id":5788284,"node_id":"MDQ6VXNlcjU3ODgyODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/5788284?v=4","gravatar_id":"","url":"https://api.github.com/users/ansarizafar","html_url":"https://github.com/ansarizafar","followers_url":"https://api.github.com/users/ansarizafar/followers","following_url":"https://api.github.com/users/ansarizafar/following{/other_user}","gists_url":"https://api.github.com/users/ansarizafar/gists{/gist_id}","starred_url":"https://api.github.com/users/ansarizafar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansarizafar/subscriptions","organizations_url":"https://api.github.com/users/ansarizafar/orgs","repos_url":"https://api.github.com/users/ansarizafar/repos","events_url":"https://api.github.com/users/ansarizafar/events{/privacy}","received_events_url":"https://api.github.com/users/ansarizafar/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T16:20:06Z","updated_at":"2018-09-19T16:20:06Z","author_association":"NONE","body":"Here is my package.json\r\n````\r\n{\r\n  \"name\": \"webeotest\",\r\n  \"version\": \"1.0.0\",\r\n  \"description\": \"\",\r\n  \"main\": \"index.js\",\r\n  \"scripts\": {\r\n    \"dev\": \"backpack\",\r\n    \"build\": \"backpack build\"\r\n  },\r\n  \"author\": \"\",\r\n  \"license\": \"ISC\",\r\n  \"devDependencies\": {\r\n    \"backpack-core\": \"^0.7.0\"\r\n  },\r\n  \"dependencies\": {\r\n    \"polka\": \"^0.5.0\"\r\n  }\r\n}\r\n````\r\nThe message of error is {code: 404}"}}
{"actor":{"display_login":"ansarizafar"}}