Is there a way to determine the state of an instance of XMLHttpRequest
that has timed out or been aborted without any action taken during the onTimeout events?
For example, when a request results in a 404 error, you can check the status
property after the request is complete. However, timeouts do not seem to provide any information. The readyState
for a timeout is 'done', and there is no response
, leaving us unaware of the reason for the lack of response (timeout, connectivity issue, abort, etc).
Context:
In my case, I am using Backbone
, which utilizes a XMLHttpRequest
from jQuery
. Errors like aborts or timeouts are not communicated by Backbone
to the application's logic, only within the XHR
instance itself.
This leads me to seek a way to retrieve this information directly from the XHR
without attaching an onTimeout
event handler, etc.
It seems like a solution could involve adjusting how the timeout event is managed, or finding a way to bring its errors to the forefront.