Skip to content

Commit 8f1ff55

Browse files
committed
Error message enhancement
1 parent 06cabdf commit 8f1ff55

File tree

11 files changed

+11
-14
lines changed

11 files changed

+11
-14
lines changed

bin/dropstack-alias

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function alias({name, url}) {
4747
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
4848
process.exit(1);
4949
}
50-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
50+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
5151
process.exit(1);
5252
});
5353
}

bin/dropstack-deploy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function sync({tarPath, token, variables, instances, alias, type, https, url}){
8282
console.log(boxen(message, {padding: 1, borderColor: 'gray', margin: 1}));
8383
})
8484
.catch(err => {
85-
console.log(err)
8685
if(err.message === 'canceled') {
8786
console.log(chalk.yellow('aborted'));
8887
return process.exit(0);
@@ -92,7 +91,7 @@ function sync({tarPath, token, variables, instances, alias, type, https, url}){
9291
console.error(chalk.red(`Verify your Dockerfile, please!`))
9392
return process.exit(1);
9493
}
95-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
94+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
9695
process.exit(1);
9796
});
9897
}

bin/dropstack-list

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function list(){
3333
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
3434
process.exit(1);
3535
}
36-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
36+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
3737
process.exit(1);
3838
});
3939
}

bin/dropstack-login

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@ function account({url, token, reset}) {
7070
console.error(chalk.red(`Sign in failed.`));
7171
return process.exit(1);
7272
}
73-
7473
if(err.message === 'Sign in failed. Use `dropstack login` to log in with your credentials.'){
7574
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
7675
process.exit(1);
7776
}
7877

79-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
78+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
8079
process.exit(1);
8180
});
8281
}

bin/dropstack-logout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function logout() {
2222
process.exit(0);
2323
})
2424
.catch(err => {
25-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
25+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
2626
process.exit(1);
2727
})
2828
}

bin/dropstack-logs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ function log({name, follow}) {
3838
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
3939
process.exit(1);
4040
}
41-
console.error(err)
42-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
41+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
4342
process.exit(1);
4443
});
4544
}

bin/dropstack-metric

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function metrics({name, live}){
3636
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
3737
process.exit(1);
3838
}
39-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
39+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
4040
process.exit(1);
4141
});
4242
}

bin/dropstack-remove

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function remove({name, force}){
8383
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
8484
process.exit(1);
8585
}
86-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
86+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
8787
process.stderr.write('\x1B[?25h'); //show terminal cursor
8888
process.exit(1);
8989
})

bin/dropstack-scale

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function scale({name, instances}) {
4747
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
4848
process.exit(1);
4949
}
50-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
50+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
5151
process.exit(1);
5252
});
5353
}

bin/dropstack-ssl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function ssl(setup) {
4646
console.error(chalk.red(`Credentials not found. Use ${chalk.bold('dropstack login')} to verifiy your credentials.`));
4747
process.exit(1);
4848
}
49-
console.error(chalk.red(`\nAn unexpected error occurred ${chalk.gray(err.message)}`));
49+
console.error(chalk.red(`\nAn unexpected error occurred! Message: "${chalk.gray(err.message)}"`));
5050
process.exit(1);
5151
});
5252
}

0 commit comments

Comments
 (0)