Skip to content

Should DisposeResources set cause or suppressed on AggregateError #112

@rbuckton

Description

@rbuckton

Related to #104, specifically this question:

...

try {
  using c = { [Symbol.dispose]() { throw new Error("c"); };
  using b = { [Symbol.dispose]() { throw new Error("b"); };
} catch (e) {
  e
}

...

I also wonder if cause is the right term here, since Error("b") did not necessarily cause Error("c"), but rather it suppresses it. Perhaps I should install a suppressed property instead?

The DisposeResources operation will construct a jagged AggregateError with the above exceptions. Since b did not "cause" c, is this the right term we should be using? Should we consider defining a suppressed property instead of a cause property to more accurately reflect the relationship? Or should we continue to use cause for simplicity's sake?

/cc: @ljharb, @bakkot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions