#718 - pass XHR (if available) to onError callback