-
Notifications
You must be signed in to change notification settings - Fork 20
Improve error messages #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
11fa9ca
to
d88f68e
Compare
d88f68e
to
1d2131a
Compare
src/commands/publish.ts
Outdated
let text = chalk.red.bold(`${msg.name}: `); | ||
text += chalk.red(err); | ||
console.error(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO&NITS
↓のような書き方の方が直感的に何をやっているかわかりやすいと感じました。
let text = chalk.red.bold(`${msg.name}: `); | |
text += chalk.red(err); | |
console.error(text); | |
const errorName = chalk.red.bold(msg.name); | |
const errorDescription = chalk.red(err); | |
console.error(`${errorName}: ${errorDescription}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメントしましたが、どちらでも良いのでLGTMです!
invalidItemMessages.forEach((msg) => { | ||
console.error(msg.name, msg.errors); | ||
msg.errors.forEach((err) => { | ||
const errorName = chalk.red.bold(msg.name + ":"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits
const errorName = chalk.red.bold(msg.name + ":"); | |
const errorName = chalk.red.bold(`${msg.name}:`); |
a1d1368
to
9468550
Compare
What
エラー発生時のメッセージがわかりにくい(何をすればいいのかわからない。なぜエラーになっているのかわからない)ため、改善する。
How
Why
Refs