{"action":"created","issue":{"url":"https://api.github.com/repos/visionmedia/supertest/issues/314","repository_url":"https://api.github.com/repos/visionmedia/supertest","labels_url":"https://api.github.com/repos/visionmedia/supertest/issues/314/labels{/name}","comments_url":"https://api.github.com/repos/visionmedia/supertest/issues/314/comments","events_url":"https://api.github.com/repos/visionmedia/supertest/issues/314/events","html_url":"https://github.com/visionmedia/supertest/issues/314","id":133542473,"number":314,"title":"When server is down, the error message is not useful","user":{"login":"sakovias","id":4750367,"avatar_url":"https://avatars3.githubusercontent.com/u/4750367?v=4","gravatar_id":"","url":"https://api.github.com/users/sakovias","html_url":"https://github.com/sakovias","followers_url":"https://api.github.com/users/sakovias/followers","following_url":"https://api.github.com/users/sakovias/following{/other_user}","gists_url":"https://api.github.com/users/sakovias/gists{/gist_id}","starred_url":"https://api.github.com/users/sakovias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakovias/subscriptions","organizations_url":"https://api.github.com/users/sakovias/orgs","repos_url":"https://api.github.com/users/sakovias/repos","events_url":"https://api.github.com/users/sakovias/events{/privacy}","received_events_url":"https://api.github.com/users/sakovias/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-02-14T14:14:16Z","updated_at":"2017-08-11T17:42:02Z","closed_at":null,"body":"My test suit is hitting a server with a bunch of requests and then checks on responses. `supertest` is really good for making tests on response body and status code easy!\n\nHowever, when the server is down for some reason the error message doesn't allow to identify the source of the problem. Me and some other folks tripped over this a bunch of times :)\n\n``` javascript\nvar request = require('supertest');\nrequest('localhost:6237')\n  .get('/')\n  .expect(200)\n  .end(function(err, res) {\n    if (err) throw err;\n    console.log('Success', res.body);\n  });\n```\n\nRunning this given the server at `localhost:6237` is down results in this stack trace:\n\n```\n$ node test.js\n/path/to/test.js:8\n    if (err) throw err;\n                   ^\nTypeError: Cannot read property 'status' of undefined\n```\n\nIs it something I can go ahead and fix or it's intended functionality?\n"},"comment":{"url":"https://api.github.com/repos/visionmedia/supertest/issues/comments/321875334","html_url":"https://github.com/visionmedia/supertest/issues/314#issuecomment-321875334","issue_url":"https://api.github.com/repos/visionmedia/supertest/issues/314","id":321875334,"user":{"login":"contra","id":425716,"avatar_url":"https://avatars0.githubusercontent.com/u/425716?v=4","gravatar_id":"","url":"https://api.github.com/users/contra","html_url":"https://github.com/contra","followers_url":"https://api.github.com/users/contra/followers","following_url":"https://api.github.com/users/contra/following{/other_user}","gists_url":"https://api.github.com/users/contra/gists{/gist_id}","starred_url":"https://api.github.com/users/contra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contra/subscriptions","organizations_url":"https://api.github.com/users/contra/orgs","repos_url":"https://api.github.com/users/contra/repos","events_url":"https://api.github.com/users/contra/events{/privacy}","received_events_url":"https://api.github.com/users/contra/received_events","type":"User","site_admin":false},"created_at":"2017-08-11T17:42:02Z","updated_at":"2017-08-11T17:42:02Z","body":"I'm still getting this error, but it seems to happen randomly. Running the tests again it doesn't happen, maybe 1 out of every 30 runs this happens on a random test."}}
{"actor":{"display_login":"contra"}}