Open Bug 1906150 Opened 1 year ago Updated 8 months ago

Improve Error messaging & stack traces for SuppressedErrors

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: debadree333, Unassigned)

References

(Blocks 1 open bug)

Details

No description provided.
Blocks: 1569081
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Improve Error messaging for SuppressedErrors → Improve Error messaging & stack traces for SuppressedErrors
Severity: -- → N/A
Priority: -- → P3

The general consensus regarding this is this should either point to the closing brace of the scope / copy the trace of .error ref [1] but presently our implementation captures the position of the first suppressed error example

{
  using x = {
    [Symbol.dispose]() {
      console.log('disposed 1');
      throw 1;
    }
  }
  using y = {
    [Symbol.dispose]() {
      console.log('disposed 2');
      throw 2;
    }
  }
}

results in:

 0:00.53 js test.js
disposed 2
disposed 1
test.js:9:5 SuppressedError: An error is suppressed because another error happened while disposing an object
Stack:
  @test.js:9:5

so this can be improved it would essentially involving tweaking the try finally blocks that surround the disposals

[1] https://github.com/tc39/proposal-explicit-resource-management/issues/235

Type: task → enhancement
Blocks: 1930461
No longer blocks: 1569081
You need to log in before you can comment on or make changes to this bug.