Uploaded image for project: 'VS Code Extension'
  1. VS Code Extension
  2. VSCODE-285

try {} catch {} indiscriminately catching all errors

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: Tech debt
    • None
    • 1
    • Not Needed

      https://github.com/mongodb-js/vscode/blob/b5300e1e77fe3f4706cbad1a924c1438855cb99c/src/explorer/playgroundsTree.ts#L185-L213

      That's a rather large chunk of code with all errors (including builtins like TypeError) ignored. Probably best to just wrap specific things that might error like (usually) file operations and then only ignore specific errors and rethrow the rest. Generally best to leave unexpected errors to bubble up and either crash the process or get caught higher up because otherwise any programmer error (and not just network or filesystem type errors) could get swallowed and we'll never even know about it.

      Or we could at least log the errors somewhere as a last resort.

      It was suggested we do all these together so I'll link them all here and then close the others.

      https://jira.mongodb.org/projects/VSCODE/issues/VSCODE-288?filter=allopenissues

      https://jira.mongodb.org/projects/VSCODE/issues/VSCODE-290?filter=allopenissues

            Assignee:
            Unassigned Unassigned
            Reporter:
            leroux.bodenstein@mongodb.com Le Roux Bodenstein
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: