{"action":"created","issue":{"url":"https://api.github.com/repos/sinonjs/sinon/issues/1040","repository_url":"https://api.github.com/repos/sinonjs/sinon","labels_url":"https://api.github.com/repos/sinonjs/sinon/issues/1040/labels{/name}","comments_url":"https://api.github.com/repos/sinonjs/sinon/issues/1040/comments","events_url":"https://api.github.com/repos/sinonjs/sinon/issues/1040/events","html_url":"https://github.com/sinonjs/sinon/issues/1040","id":152634223,"number":1040,"title":"fakeServer is broken with .respond(500) on 1.17.4","user":{"login":"gil","id":116157,"avatar_url":"https://avatars.githubusercontent.com/u/116157?v=3","gravatar_id":"","url":"https://api.github.com/users/gil","html_url":"https://github.com/gil","followers_url":"https://api.github.com/users/gil/followers","following_url":"https://api.github.com/users/gil/following{/other_user}","gists_url":"https://api.github.com/users/gil/gists{/gist_id}","starred_url":"https://api.github.com/users/gil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gil/subscriptions","organizations_url":"https://api.github.com/users/gil/orgs","repos_url":"https://api.github.com/users/gil/repos","events_url":"https://api.github.com/users/gil/events{/privacy}","received_events_url":"https://api.github.com/users/gil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sinonjs/sinon/labels/Difficulty:%20Tough","name":"Difficulty: Tough","color":"bfdadc"},{"url":"https://api.github.com/repos/sinonjs/sinon/labels/Help%20wanted","name":"Help wanted","color":"0052cc"},{"url":"https://api.github.com/repos/sinonjs/sinon/labels/Needs%20investigation","name":"Needs investigation","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"fearphage","id":23887,"avatar_url":"https://avatars.githubusercontent.com/u/23887?v=3","gravatar_id":"","url":"https://api.github.com/users/fearphage","html_url":"https://github.com/fearphage","followers_url":"https://api.github.com/users/fearphage/followers","following_url":"https://api.github.com/users/fearphage/following{/other_user}","gists_url":"https://api.github.com/users/fearphage/gists{/gist_id}","starred_url":"https://api.github.com/users/fearphage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fearphage/subscriptions","organizations_url":"https://api.github.com/users/fearphage/orgs","repos_url":"https://api.github.com/users/fearphage/repos","events_url":"https://api.github.com/users/fearphage/events{/privacy}","received_events_url":"https://api.github.com/users/fearphage/received_events","type":"User","site_admin":false},"assignees":[{"login":"fearphage","id":23887,"avatar_url":"https://avatars.githubusercontent.com/u/23887?v=3","gravatar_id":"","url":"https://api.github.com/users/fearphage","html_url":"https://github.com/fearphage","followers_url":"https://api.github.com/users/fearphage/followers","following_url":"https://api.github.com/users/fearphage/following{/other_user}","gists_url":"https://api.github.com/users/fearphage/gists{/gist_id}","starred_url":"https://api.github.com/users/fearphage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fearphage/subscriptions","organizations_url":"https://api.github.com/users/fearphage/orgs","repos_url":"https://api.github.com/users/fearphage/repos","events_url":"https://api.github.com/users/fearphage/events{/privacy}","received_events_url":"https://api.github.com/users/fearphage/received_events","type":"User","site_admin":false}],"milestone":null,"comments":31,"created_at":"2016-05-02T20:12:43Z","updated_at":"2016-07-24T06:35:56Z","closed_at":null,"body":"Hi guys,\r\n\r\nI'm using `karma-sinon` and it's always installing Sinon's latest version by default. It seems that the version 1.17.4 broke this for me:\r\n\r\n`this.server.requests[0].respond(500, { 'Content-Type' : 'application/json' }, JSON.stringify({}));`\r\n\r\nIt won't call the error handler on my Ajax call. For some reason, I can't even find the tag for this version here on Github, to help debug the problem. As a workaround, I've downgraded to 1.17.3 and ran shrinkwrap on my project to be safe.\r\n\r\n* Sinon version : 1.17.4\r\n* Environment   : OSX\r\n* Other libraries you are using: karma-sinon\r\n\r\n**What did you expect to happen?**\r\nAjax error to be triggered.\r\n\r\n**What actually happens**\r\nI won't trigger my Ajax error handler.\r\n\r\n**How to reproduce**\r\n```\r\nthis.server = sinon.fakeServer.create();\r\nthis.server.requests[0].respond(500, { 'Content-Type' : 'application/json' }, JSON.stringify({}));\r\n```"},"comment":{"url":"https://api.github.com/repos/sinonjs/sinon/issues/comments/234760850","html_url":"https://github.com/sinonjs/sinon/issues/1040#issuecomment-234760850","issue_url":"https://api.github.com/repos/sinonjs/sinon/issues/1040","id":234760850,"user":{"login":"nyk0r","id":303423,"avatar_url":"https://avatars.githubusercontent.com/u/303423?v=3","gravatar_id":"","url":"https://api.github.com/users/nyk0r","html_url":"https://github.com/nyk0r","followers_url":"https://api.github.com/users/nyk0r/followers","following_url":"https://api.github.com/users/nyk0r/following{/other_user}","gists_url":"https://api.github.com/users/nyk0r/gists{/gist_id}","starred_url":"https://api.github.com/users/nyk0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyk0r/subscriptions","organizations_url":"https://api.github.com/users/nyk0r/orgs","repos_url":"https://api.github.com/users/nyk0r/repos","events_url":"https://api.github.com/users/nyk0r/events{/privacy}","received_events_url":"https://api.github.com/users/nyk0r/received_events","type":"User","site_admin":false},"created_at":"2016-07-24T06:35:56Z","updated_at":"2016-07-24T06:35:56Z","body":"According to the spec onerror event is triggered only when a network level event like a DNS timeout or not responsive server happens. 500 or 404 are just normal HTTP responses and it's up to an application to decide whether an error has accorded. https://www.w3.org/TR/XMLHttpRequest/#event-xhr-error\r\nThe spec is too concise as usual. Non 2xx responses are considered to be errors by jQuery, that's why many people are confused by XMLHttpRequest's behavior."}}
{"actor":{"display_login":"nyk0r"}}