My use case is if the browser becomes offline and the XHR requests begin to error, my JS app continues to run and watch for online availability.
This adds a hook to push null into the latency array if the XHR request responded with the error event, allowing the net.latency.on( 'end' ) callback to receive null information and conclude there is no connection. Not sure if these needs to accommodate for intentional server errors, but it's an improvement in my case.
My use case is if the browser becomes offline and the XHR requests begin to error, my JS app continues to run and watch for online availability.
This adds a hook to push
null
into the latency array if the XHR request responded with the error event, allowing thenet.latency.on( 'end' )
callback to receivenull
information and conclude there is no connection. Not sure if these needs to accommodate for intentional server errors, but it's an improvement in my case.