[CB-1666] wrapper XHR response access in try/catch

see: https://issues.apache.org/jira/browse/CB-1666
diff --git a/weinre.doc/ChangeLog.body.html b/weinre.doc/ChangeLog.body.html
index 1d2e0ad..f1bd9b9 100644
--- a/weinre.doc/ChangeLog.body.html
+++ b/weinre.doc/ChangeLog.body.html
@@ -47,6 +47,7 @@
 <li><a href="https://issues.apache.org/jira/browse/CB-540">CB-540</a>  - ability to easily navigate to particular place in DOM via bookmarks/jump to selector
 <li><a href="https://issues.apache.org/jira/browse/CB-873">CB-873</a>  - setTimeout() and setInterval() usage with string arguments is busted
 <li><a href="https://issues.apache.org/jira/browse/CB-984">CB-984</a>  - cannot install weinre with Node 0.8.0
+<li><a href="https://issues.apache.org/jira/browse/CB-1666">CB-1666</a> - "INVALID_STATE_ERR: DOM Exception 11" with chbrody/Cordova-SQLitePlugin
 </ul>
 
 <!-- ======================================================================= -->
diff --git a/weinre.web/modules/weinre/target/NetworkRequest.coffee b/weinre.web/modules/weinre/target/NetworkRequest.coffee
index 92ddee6..8a33ad5 100644
--- a/weinre.web/modules/weinre/target/NetworkRequest.coffee
+++ b/weinre.web/modules/weinre/target/NetworkRequest.coffee
@@ -57,7 +57,12 @@
 
     #---------------------------------------------------------------------------
     handleDone: ->
-        sourceString = @xhr.responseText
+        sourceString = ""
+        try
+            sourceString = @xhr.responseText
+        catch e
+            # leave sourceString as ""
+
         Weinre.wi.NetworkNotify.setInitialContent(@id, sourceString, "XHR")
 
         time       = Date.now() / 1000.0
@@ -120,14 +125,14 @@
 
 #-------------------------------------------------------------------------------
 getResponse = (xhr) ->
-    contentType = xhr.getResponseHeader("Content-Type") 
+    contentType = xhr.getResponseHeader("Content-Type")
     contentType ||= 'application/octet-stream'
 
     [contentType, encoding] = splitContentType(contentType)
 
     headers = getHeaders(xhr)
 
-    result = 
+    result =
         mimeType:              contentType
         textEncodingName:      encoding
         httpStatusCode:        xhr.status
@@ -136,7 +141,7 @@
         connectionReused:      false
         connectionID:          0
         wasCached:             false
-    
+
     contentLength = xhr.getResponseHeader("Content-Length")
     contentLength = parseInt(contentLength)
     result.expectedContentLength = contentLength if !isNaN(contentLength)
@@ -186,8 +191,11 @@
         nr = xhr.__weinreNetworkRequest__
         return unless nr
 
-        switch xhr.readyState
-            when 2 then nr.handleHeadersReceived()
-            when 3 then nr.handleLoading()
-            when 4 then nr.handleDone()
+        try
+            switch xhr.readyState
+                when 2 then nr.handleHeadersReceived()
+                when 3 then nr.handleLoading()
+                when 4 then nr.handleDone()
+        catch e
+            # do nothing