Pārlūkot izejas kodu

Make permission error clear

Michelle Bu 11 gadi atpakaļ
vecāks
revīzija
d53d870e67
3 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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) {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 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) {

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels