Skip to content
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

Errors from recursive-readdir are ignored #18

Open
GMNGeoffrey opened this issue Jul 23, 2020 · 0 comments
Open

Errors from recursive-readdir are ignored #18

GMNGeoffrey opened this issue Jul 23, 2020 · 0 comments

Comments

@GMNGeoffrey
Copy link

My workspace has some weird files in the repository due to bazel builds. I didn't properly exclude them (because it looks like exclusions are expected to match on the absolute path, not relative to the workspace root, as I expected, #17). The error I get is the rather misleading Warning, no matches were found. I was able to debug the issue by fiddling with the local install of the extension. It looks like there's a readErr there, but it's unused. Maybe it should be surfaced to the user.

I'd think that that a simple

if (readErr) {
  showError(readErr);
}

would do it, but it looks like in the error case that callback gets called multiple times and since the error messages are different, vscode doesn't de-dupe them and crashes. What about converting to the promise syntax and using that?

      recursive(folderFullPath, searchExclusion,).then((files) => {
          // ...
        }, (err) => {
         showError(err);
        }
      );

Then everything only gets called once. Happy to send a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant