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

try {} catch {} used to wrap promise.then

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: Tech debt
    • None
    • 2
    • Not Needed

      Some usage of .then() called on a promise with no .catch() inside a try {} catch {}. Not sure if the try/catch is there to catch errors in those promises, but it will only catch the synchronous errors. I'd suggest moving the try/catch to only wrap the code that can throw and be caught by that catch. Or removing it. Maybe rather await the promise rather than use .then() and then errors will correctly bubble up.

      There are at least four cases here: https://github.com/mongodb-js/vscode/blob/b5300e1e77fe3f4706cbad1a924c1438855cb99c/src/language/mongoDBService.ts#L214-L216

            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: