Try-catching XMLHttpRequest.