Browse Source

Make permission error clear

Michelle Bu 11 năm trước cách đây
mục cha
commit
d53d870e67
3 tập tin đã thay đổi với 2 bổ sung2 xóa
  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'
           + ' 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([]);
       return;
     } else if (http.status !== 200) {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 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'
           + ' 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([]);
       return;
     } else if (http.status !== 200) {

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác