microsoft / codetour

VS Code extension that allows you to record and play back guided tours of codebases, directly within the editor.
https://aka.ms/codetour
MIT License
4.36k stars 113 forks source link

Debug Console always shows errors open startup of Codetour #297

Open AlexanderLill opened 6 months ago

AlexanderLill commented 6 months ago

Hey everyone,

I have the codetours extension installed, and when I open the debug console panel in vscode, the following errors are shown. Maybe there is a way to avoid these when the tours folder does not exist?

Also, it was quite a hassle to identify where these error messages come from, as the debug console does not indicate from which extension/code file the messages originate.

I have version v0.0.59 of CodeTour and version Version: 1.87.2 of vscode.

[node.js fs] readdir with filetypes failed with error:  Error: ENOENT: no such file or directory, scandir '/Users/username/code/reponame/.vscode/tours' {errno: -2, code: 'ENOENT', syscall: 'scandir', path: '/Users/username/code/reponame/.vscode/tours', stack: 'Error: ENOENT: no such file or directory, sca…'/Users/username/code/reponame/.vscode/tours'', …}

extensionHostProcess.js:144
[node.js fs] readdir with filetypes failed with error:  Error: ENOENT: no such file or directory, scandir '/Users/username/code/reponame/.github/tours' {errno: -2, code: 'ENOENT', syscall: 'scandir', path: '/Users/username/code/reponame/.github/tours', stack: 'Error: ENOENT: no such file or directory, sca…'/Users/username/code/reponame/.github/tours'', …}

extensionHostProcess.js:144
[node.js fs] readdir with filetypes failed with error:  Error: ENOENT: no such file or directory, scandir '/Users/username/code/reponame/.tours' {errno: -2, code: 'ENOENT', syscall: 'scandir', path: '/Users/username/code/ts-wifi-test/.tours', stack: 'Error: ENOENT: no such file or directory, scandir '/Users/username/code/reponame/.tours'', …}
### Tasks
AlexanderLill commented 6 months ago

Seems that the discoverMainTours function uses a try/catch to avoid these errors, while the discoverSubTours function does not do that: https://github.com/microsoft/codetour/blob/9f29dd9021d9d47246a7acff37bb82e28bd58b8d/src/store/provider.ts#L88-L94 https://github.com/microsoft/codetour/blob/9f29dd9021d9d47246a7acff37bb82e28bd58b8d/src/store/provider.ts#L141-L144