This repository was archived by the owner on Sep 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed
Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ function main() {
6969
7070 var cluster = clusterManager . getClusterAt ( 0 ) ;
7171
72+ if ( ! cluster ) {
73+ console . error ( 'Error: no members in the cluster could be reached' ) ;
74+ process . exit ( 1 ) ;
75+ }
76+
7277 if ( program . members ) {
7378 console . log ( cluster . getNodeCount ( ) ) ;
7479 process . exit ( ) ;
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ Cluster.prototype.fetchStats = function fetchStats(callback) {
138138 statsObj . address = memberAddr ;
139139
140140 if ( err ) {
141- next ( null , statsObj ) ;
141+ next ( err , statsObj ) ;
142142 return ;
143143 }
144144
Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ function main() {
6262
6363 var cluster = clusterManager . getClusterAt ( 0 ) ;
6464
65+ if ( ! cluster ) {
66+ console . error ( 'Error: no members in the cluster could be reached' ) ;
67+ process . exit ( 1 ) ;
68+ }
69+
6570 if ( program . members ) {
6671 printSorted ( cluster . getMemberAddrs ( ) ) ;
6772 process . exit ( ) ;
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ function main() {
4444
4545 var table = createTable ( [ ] ) ;
4646 var cluster = clusterManager . getClusterAt ( 0 ) ;
47+ if ( ! cluster ) {
48+ console . error ( 'Error: no members in the cluster could be reached' ) ;
49+ process . exit ( 1 ) ;
50+ }
4751 cluster . membership . forEach ( function each ( member ) {
4852 table . push ( [ member . address , member . status ] ) ;
4953 } ) ;
You can’t perform that action at this time.
0 commit comments