瀏覽代碼

Make permission error clear

Michelle Bu 11 年之前
父節點
當前提交
d53d870e67
共有 3 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      dist/peer.js
  2. 0 0
      dist/peer.min.js
  3. 1 1
      lib/peer.js

+ 1 - 1
dist/peer.js

@@ -1798,7 +1798,7 @@ Peer.prototype.listAllPeers = function(cb) {
         helpfulError = 'You need to enable `allow_discovery` on your self-hosted'
         helpfulError = 'You need to enable `allow_discovery` on your self-hosted'
           + ' PeerServer to use this feature.';
           + ' PeerServer to use this feature.';
       }
       }
-      self._abort('permissions-error', 'It doesn\'t look like you have permission to list peers IDs.');
+      throw new Error('It doesn\'t look like you have permission to list peers IDs. ' + helpfulError);
       cb([]);
       cb([]);
       return;
       return;
     } else if (http.status !== 200) {
     } else if (http.status !== 200) {

文件差異過大導致無法顯示
+ 0 - 0
dist/peer.min.js


+ 1 - 1
lib/peer.js

@@ -430,7 +430,7 @@ Peer.prototype.listAllPeers = function(cb) {
         helpfulError = 'You need to enable `allow_discovery` on your self-hosted'
         helpfulError = 'You need to enable `allow_discovery` on your self-hosted'
           + ' PeerServer to use this feature.';
           + ' PeerServer to use this feature.';
       }
       }
-      self._abort('permissions-error', 'It doesn\'t look like you have permission to list peers IDs.');
+      throw new Error('It doesn\'t look like you have permission to list peers IDs. ' + helpfulError);
       cb([]);
       cb([]);
       return;
       return;
     } else if (http.status !== 200) {
     } else if (http.status !== 200) {

部分文件因文件數量過多而無法顯示