Avoid uninteresting user facing errors#706
Merged
aeisenberg merged 2 commits intogithub:mainfrom Dec 15, 2020
Merged
Conversation
e11ef0f to
574da6f
Compare
adityasharad
approved these changes
Dec 14, 2020
| // 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.`); |
Contributor
There was a problem hiding this comment.
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.
Suggested change
| 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.`); |
Contributor
Author
There was a problem hiding this comment.
Let me do that and fix it up a bit more.
Contributor
Author
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
You had a log message for this before, I suggest keeping that.
When directory is not present.
adityasharad
approved these changes
Dec 15, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-dsphas been cc'd in all issues for UI or other user-facing changes made by this pull request.