{"action":"closed","issue":{"url":"https://api.github.com/repos/visionmedia/supertest/issues/276","labels_url":"https://api.github.com/repos/visionmedia/supertest/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/visionmedia/supertest/issues/276/comments","events_url":"https://api.github.com/repos/visionmedia/supertest/issues/276/events","html_url":"https://github.com/visionmedia/supertest/issues/276","id":104445141,"number":276,"title":"Breaking API Change in 1.1.0 — Non-2xx HTTP codes doesn't trigger error","user":{"login":"elmigranto","id":886388,"avatar_url":"https://avatars.githubusercontent.com/u/886388?v=3","gravatar_id":"","url":"https://api.github.com/users/elmigranto","html_url":"https://github.com/elmigranto","followers_url":"https://api.github.com/users/elmigranto/followers","following_url":"https://api.github.com/users/elmigranto/following{/other_user}","gists_url":"https://api.github.com/users/elmigranto/gists{/gist_id}","starred_url":"https://api.github.com/users/elmigranto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elmigranto/subscriptions","organizations_url":"https://api.github.com/users/elmigranto/orgs","repos_url":"https://api.github.com/users/elmigranto/repos","events_url":"https://api.github.com/users/elmigranto/events{/privacy}","received_events_url":"https://api.github.com/users/elmigranto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-02T10:04:08Z","updated_at":"2015-09-16T23:37:03Z","closed_at":"2015-09-16T23:37:03Z","body":"Consider following code:\r\n\r\n``` js\r\nvar http = require('http');\r\nvar supertest = require('supertest');\r\n\r\nvar server = http.createServer(function (req, res) {\r\n  res.writeHead(400);\r\n  res.end();\r\n});\r\n\r\nsupertest(server)\r\n  .get('/')\r\n  .end(function (err, res) {\r\n    console.log(err ? 'has error' : 'no error');\r\n  });\r\n\r\n```\r\n\r\nI tried a bunch of HTTP methods and non-2xx HTTP codes, and for all of them it prints:\r\n-  `no error` for version 1.1.0;\r\n- `has error` for version 1.0.1.\r\n\r\nThis looks to me like a major API change that breaks backwards compatibility and probably requires major version bump in accordance with semver, what do you think?"}}