@@ -100,23 +100,27 @@ module.exports = function(CLI) {
100100 var Log = require ( './Log' ) ;
101101
102102 that . Client . executeRemote ( 'getReport' , { } , function ( err , report ) {
103+
103104 console . log ( )
104105 console . log ( )
105106 console . log ( )
106107 console . log ( '```' )
107108 fmt . title ( 'PM2 report' )
108109 fmt . field ( 'Date' , new Date ( ) ) ;
109110 fmt . sep ( ) ;
110- fmt . title ( chalk . bold . blue ( 'Daemon' ) ) ;
111- fmt . field ( 'pm2d version' , report . pm2_version ) ;
112- fmt . field ( 'node version' , report . node_version ) ;
113- fmt . field ( 'node path' , report . node_path ) ;
114- fmt . field ( 'argv' , report . argv ) ;
115- fmt . field ( 'argv0' , report . argv0 ) ;
116- fmt . field ( 'user' , report . user ) ;
117- fmt . field ( 'uid' , report . uid ) ;
118- fmt . field ( 'gid' , report . gid ) ;
119- fmt . field ( 'uptime' , dayjs ( new Date ( ) ) . diff ( report . started_at , 'minute' ) + 'min' ) ;
111+
112+ if ( report && ! err ) {
113+ fmt . title ( chalk . bold . blue ( 'Daemon' ) ) ;
114+ fmt . field ( 'pm2d version' , report . pm2_version ) ;
115+ fmt . field ( 'node version' , report . node_version ) ;
116+ fmt . field ( 'node path' , report . node_path ) ;
117+ fmt . field ( 'argv' , report . argv ) ;
118+ fmt . field ( 'argv0' , report . argv0 ) ;
119+ fmt . field ( 'user' , report . user ) ;
120+ fmt . field ( 'uid' , report . uid ) ;
121+ fmt . field ( 'gid' , report . gid ) ;
122+ fmt . field ( 'uptime' , dayjs ( new Date ( ) ) . diff ( report . started_at , 'minute' ) + 'min' ) ;
123+ }
120124
121125 fmt . sep ( ) ;
122126 fmt . title ( chalk . bold . blue ( 'CLI' ) ) ;
0 commit comments