microsoft / codetour

VS Code extension that allows you to record and play back guided tours of codebases, directly within the editor.

Home Page:https://aka.ms/codetour

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debug Console always shows errors open startup of Codetour

AlexanderLill opened this issue · comments

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

No tasks being tracked yet.

Seems that the discoverMainTours function uses a try/catch to avoid these errors, while the discoverSubTours function does not do that:

async function discoverMainTours(
workspaceUri: vscode.Uri
): Promise<CodeTour[]> {
const tours = await Promise.all(
MAIN_TOUR_FILES.map(async tourFile => {
try {
const uri = vscode.Uri.joinPath(workspaceUri, tourFile);

async function discoverSubTours(workspaceUri: vscode.Uri): Promise<CodeTour[]> {
const tours = await Promise.all(
SUB_TOUR_DIRECTORIES.map(directory => {
const uri = vscode.Uri.joinPath(workspaceUri, directory);