-
Notifications
You must be signed in to change notification settings - Fork 904
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
doctor: add error messages for failures #672
doctor: add error messages for failures #672
Conversation
@jmeistrich can I ask you to rebase? We've added types to doctor command and now conflicts arisen |
7377a45
to
95d863e
Compare
CI is failing because of known race conditions (with yet unknown cause) in config test |
Thank you! |
Happy to help! |
}) => { | ||
const symbol = needsToBeFixed | ||
? isRequired | ||
? chalk.red('✖') | ||
: chalk.yellow('●') | ||
: chalk.green('✓'); | ||
|
||
logger.log(` ${symbol} ${label}`); | ||
logger.log(` ${symbol} ${label}${needsToBeFixed ? ': ' + description : ''}`); |
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.
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.
That's the reason – to show why the check failed. We treat it as first pass, feel free to iterate on how to present it better :)
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.
Perhaps it would be nice to show this only with --verbose
?
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.
Nah, why hiding the reason behind failure? Running doctor again may take some time as well.
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.
Good point.
I would like to, at least, get rid of should be installed
as there isn't much being provided there, thoughts?
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.
You mean that each health check file can provide its own description
?
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.
Something like this could be added to getDiagnostics()
output. Currently needsToBeFixed
can be a boolean or string. But we could make it a bit more explicit and add extra information like error message/descirption. Or we can keep the current behavior and only do something like:
getDiagnostics: async () => ({
needsToBeFixed: await checkSoftwareInstalled('pod') || "custom message",
}),
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.
If I got what you mean right, it would be nice to do:
getDiagnostics: async () => ({
description: 'required for installing dependencies',
needsToBeFixed: await checkSoftwareInstalled('pod'),
}),
Is that it?
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.
Could be, I'm ok with that.
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.
Summary:
This adds error messages for failing checks.