Reject promise on request timeout
Firefox and Chrome trigger the request's `onerror` handler when a timeout occurs. Safari triggers the `ontimeout` handler. This can be observed by making a request to an unroutable address: var xhr = new XMLHttpRequest() xhr.onload = console.log.bind(console, 'loaded') xhr.onerror = console.log.bind(console, 'errored') xhr.ontimeout = console.log.bind(console, 'timeout') xhr.open('GET', 'http://10.255.255.1') xhr.send() Fixes #294.
Showing
想要评论请 注册 或 登录