Fixes ticket #61 - adds catches where necessary to handle errors thrown only by IE.

This commit is contained in:
Michael Jumper
2011-12-11 12:21:34 -08:00
parent d5b093023f
commit ece9aa850e

View File

@@ -223,8 +223,15 @@ Guacamole.HTTPTunnel = function(tunnelURL) {
return; return;
} }
// Attempt to read status
var status;
try { status = xmlhttprequest.status; }
// If status could not be read, assume successful.
catch (e) { status = 200; }
// Start next request as soon as possible IF request was successful // Start next request as soon as possible IF request was successful
if (xmlhttprequest.readyState >= 2 && nextRequest == null && xmlhttprequest.status == 200) if (xmlhttprequest.readyState >= 2 && nextRequest == null && status == 200)
nextRequest = makeRequest(); nextRequest = makeRequest();
// Parse stream when data is received and when complete. // Parse stream when data is received and when complete.
@@ -261,7 +268,12 @@ Guacamole.HTTPTunnel = function(tunnelURL) {
return; return;
} }
var current = xmlhttprequest.responseText; // Attempt to read in-progress data
var current;
try { current = xmlhttprequest.responseText; }
// Do not attempt to parse if data could not be read
catch (e) { return; }
// While search is within currently received data // While search is within currently received data
while (elementEnd < current.length) { while (elementEnd < current.length) {