-
Notifications
You must be signed in to change notification settings - Fork 29
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
Improve tracked tree open file error notifications #528
Conversation
|
||
if ( | ||
error.message.includes( | ||
'File seems to be binary and cannot be opened as 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.
[F] There is nothing in the error object outside of the message that is useful in terms of deciphering what the error was. Relying on "free text" is risky and brittle but there is no other option outside of removing openResource altogether.
it('should call showErrorMessage when dvc.views.trackedExplorerTree.openFile tries to open a binary file', async () => { | ||
const path = join(dvcDemoPath, 'model.pt') | ||
const uri = Uri.file(path) | ||
it('should only call showInformationMessage when trying to open a binary file without the no binary errors option set', async () => { |
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.
[F] This is when given, when, then would be super handy
698c6e4
to
979f707
Compare
Code Climate has analyzed commit 5e98dd9 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 96.3% (85% is the threshold). This pull request will bring the total coverage in the repository to 90.2% (0.1% change). View more on Code Climate. |
From #330 (comment) - The level of the message is too high and there should be different actions based on whether the file is disk or appears binary.
This PR
Demo:
Screen.Recording.2021-06-04.at.5.01.10.pm.mov
LMK if you have any questions, comments, concerns.
Thanks,