{"action":"created","issue":{"url":"https://api.github.com/repos/KleeGroup/focus/issues/121","labels_url":"https://api.github.com/repos/KleeGroup/focus/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/KleeGroup/focus/issues/121/comments","events_url":"https://api.github.com/repos/KleeGroup/focus/issues/121/events","html_url":"https://github.com/KleeGroup/focus/issues/121","id":86584427,"number":121,"title":"Fetch response status code","user":{"login":"Tsj-","id":6391835,"avatar_url":"https://avatars.githubusercontent.com/u/6391835?v=3","gravatar_id":"","url":"https://api.github.com/users/Tsj-","html_url":"https://github.com/Tsj-","followers_url":"https://api.github.com/users/Tsj-/followers","following_url":"https://api.github.com/users/Tsj-/following{/other_user}","gists_url":"https://api.github.com/users/Tsj-/gists{/gist_id}","starred_url":"https://api.github.com/users/Tsj-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tsj-/subscriptions","organizations_url":"https://api.github.com/users/Tsj-/orgs","repos_url":"https://api.github.com/users/Tsj-/repos","events_url":"https://api.github.com/users/Tsj-/events{/privacy}","received_events_url":"https://api.github.com/users/Tsj-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-09T12:35:57Z","updated_at":"2015-06-19T10:24:57Z","closed_at":null,"body":"The way to check an error is to compare the status code of the response to \"200\".\r\n\r\nIt would be better to check the all range of success code:\r\n\r\nvar status = request.status;\r\n      if (status < 200 || status >= 300 ) {\r\n        var err = JSON.parse(request.response);\r\n        err.statusCode = status;\r\n        failure(err);\r\n      }"},"comment":{"url":"https://api.github.com/repos/KleeGroup/focus/issues/comments/113461919","html_url":"https://github.com/KleeGroup/focus/issues/121#issuecomment-113461919","issue_url":"https://api.github.com/repos/KleeGroup/focus/issues/121","id":113461919,"user":{"login":"pierr","id":286966,"avatar_url":"https://avatars.githubusercontent.com/u/286966?v=3","gravatar_id":"","url":"https://api.github.com/users/pierr","html_url":"https://github.com/pierr","followers_url":"https://api.github.com/users/pierr/followers","following_url":"https://api.github.com/users/pierr/following{/other_user}","gists_url":"https://api.github.com/users/pierr/gists{/gist_id}","starred_url":"https://api.github.com/users/pierr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierr/subscriptions","organizations_url":"https://api.github.com/users/pierr/orgs","repos_url":"https://api.github.com/users/pierr/repos","events_url":"https://api.github.com/users/pierr/events{/privacy}","received_events_url":"https://api.github.com/users/pierr/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T10:24:57Z","updated_at":"2015-06-19T10:24:57Z","body":"Fix https://github.com/KleeGroup/focus/commit/d4f556e9883725dc0511eb559bc0229065cd53f2"}}