-
Notifications
You must be signed in to change notification settings - Fork 189
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
Avoid uninteresting user facing errors #706
Conversation
e11ef0f
to
574da6f
Compare
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.
Nice!
// remove non-databases | ||
dbDirs = await asyncFilter(dbDirs, isLikelyDatabaseRoot); | ||
} catch (e) { | ||
logger.log(`Not able to find the storage path '${e.message}'. Ignoring request to remove orphaned database directories.`); |
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.
Minor: You could do a check up front with await fs.exists(this.storagePath)
so that we can distinguish between the storage path not existing, and some other failure to read its contents.
logger.log(`Not able to find the storage path '${e.message}'. Ignoring request to remove orphaned database directories.`); | |
logger.log(`Not able to read from the storage path '${e.message}'. Ignoring request to remove orphaned database directories.`); |
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.
Let me do that and fix it up a bit 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.
OK. I removed the try/catch around collecting the dbDirs
since if there is an error at this point, that indicates something much stranger going on that might actually be important for the user.
This change avoids popping up error messages in two cases: 1. When doing test discovery, do not run discovery on non-existant directories. Also, if there is an error, print to the log, and do not pop up an error window. The reason is that test discovery is a background operation and these should not normally cause pop-ups. 2. When looking for orphaned databases, don't pop up an error if the storagePath can't be found. This is normal when working in a new, single root workspace.
574da6f
to
f6ed602
Compare
!(await fs.pathExists(this.storagePath) || | ||
!(await fs.stat(this.storagePath)).isDirectory()) | ||
) { | ||
// ignore a missing or invalid storage directory. |
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 had a log message for this before, I suggest keeping 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.
Sure.
When directory is not present.
This change avoids popping up error messages in two cases:
directories. Also, if there is an error, print to the log, and do not
pop up an error window. The reason is that test discovery is a
background operation and these should not normally cause pop-ups.
storagePath can't be found. This is normal when working in a new,
single root workspace.
Fixes #695
Checklist
@github/docs-content-dsp
has been cc'd in all issues for UI or other user-facing changes made by this pull request.