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

try {} catch {} indiscriminately catching all errors

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Story Points:
      1

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: