Skip to content

Commit

Permalink
Update cli.js to include dropouts
Browse files Browse the repository at this point in the history
Handle dropouts in the JSON
  • Loading branch information
RugoseCone committed Oct 26, 2018
1 parent 2d51aa4 commit da9a265
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,15 @@ st.on('done', () => {

st.on('error', err => {
if (err.code === 'ENOTFOUND') {
if (cli.flags.json) {
stats.ping = 0;
stats.upload = 0;
stats.download = 0;
console.log(JSON.stringify(stats));
return;
}
logError('Please check your internet connection');

} else {
logError(err);
}
Expand Down

0 comments on commit da9a265

Please sign in to comment.