{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/faux-jax/issues/5","labels_url":"https://api.github.com/repos/algolia/faux-jax/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/algolia/faux-jax/issues/5/comments","events_url":"https://api.github.com/repos/algolia/faux-jax/issues/5/events","html_url":"https://github.com/algolia/faux-jax/issues/5","id":60383313,"number":5,"title":"faux network error","user":{"login":"terinjokes","id":273509,"avatar_url":"https://avatars.githubusercontent.com/u/273509?v=3","gravatar_id":"","url":"https://api.github.com/users/terinjokes","html_url":"https://github.com/terinjokes","followers_url":"https://api.github.com/users/terinjokes/followers","following_url":"https://api.github.com/users/terinjokes/following{/other_user}","gists_url":"https://api.github.com/users/terinjokes/gists{/gist_id}","starred_url":"https://api.github.com/users/terinjokes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terinjokes/subscriptions","organizations_url":"https://api.github.com/users/terinjokes/orgs","repos_url":"https://api.github.com/users/terinjokes/repos","events_url":"https://api.github.com/users/terinjokes/events{/privacy}","received_events_url":"https://api.github.com/users/terinjokes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-03-09T17:54:35Z","updated_at":"2015-04-02T18:41:21Z","closed_at":null,"body":"There doesn't seem to be a way to fake a network error, and trigger the second step of https://xhr.spec.whatwg.org/#handle-errors.\r\n\r\nThe closest we have is `xhr.abort()`, which sets the response to a NetworkError error, and follows the \"end-user abort\" steps. Notably, it does not trigger the \"error\" event.\r\n\r\nWould you be interested in a pull request for this functionality?\r\n\r\n---\r\n\r\nIn libraries, this is resolvable by handling the \"readystatechange\" event instead of \"load\" and \"error\", but I still believe it's a bug that this code path is not triggerable."},"comment":{"url":"https://api.github.com/repos/algolia/faux-jax/issues/comments/89005342","html_url":"https://github.com/algolia/faux-jax/issues/5#issuecomment-89005342","issue_url":"https://api.github.com/repos/algolia/faux-jax/issues/5","id":89005342,"user":{"login":"vvo","id":123822,"avatar_url":"https://avatars.githubusercontent.com/u/123822?v=3","gravatar_id":"","url":"https://api.github.com/users/vvo","html_url":"https://github.com/vvo","followers_url":"https://api.github.com/users/vvo/followers","following_url":"https://api.github.com/users/vvo/following{/other_user}","gists_url":"https://api.github.com/users/vvo/gists{/gist_id}","starred_url":"https://api.github.com/users/vvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvo/subscriptions","organizations_url":"https://api.github.com/users/vvo/orgs","repos_url":"https://api.github.com/users/vvo/repos","events_url":"https://api.github.com/users/vvo/events{/privacy}","received_events_url":"https://api.github.com/users/vvo/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T18:41:21Z","updated_at":"2015-04-02T18:41:21Z","body":"I am sorry I thought ypu could just trigger it by hand: xhr.onerror() will trigger any handler attached to onerror. hacky but works"}}