Browse Source

throw if could not get id from server

ericz 12 years ago
parent
commit
c36e1be28f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lib/peer.js

+ 4 - 0
lib/peer.js

@@ -82,6 +82,10 @@ Peer.prototype._retrieveId = function(cb) {
     http.open('get', url, true);
     http.onreadystatechange = function() {
       if (http.readyState === 4) {
+        if (http.status !== 200) {
+          throw 'Retrieve id response not 200';
+          return;
+        }
         self.id = http.responseText;
         self._init();
       }