Selaa lähdekoodia

Make permission error clear

Michelle Bu 11 vuotta sitten
vanhempi
commit
d53d870e67
3 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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) {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 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) {

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä