endo icon indicating copy to clipboard operation
endo copied to clipboard

feat(ses): add aggregateLoadErrors flag

Open boneskull opened this issue 6 months ago • 2 comments

Refs: #2820

Description

This adds the aggregateLoadErrors flag to the Compartment constructor in its CompartmentOptions. The default value of this flag is true, which retains the current behavior.

If false, this will cause the first error encountered during load (load or loadNow) to be thrown or rejected.

~~A second PR (or subsequent commit in this PR) will thread this flag through @endo/compartment-mapper where it can more easily be provided (e.g., to importLocation(), loadFromMap(), etc.).~~ This won't be strictly necessary for @lavamoat/node's use-case, so I'd rather just kick the can down the road until it's needed.

Security Considerations

none that I'm aware of

Scaling Considerations

n/a

Documentation Considerations

The aggregateLoadErrors flag should be documented w/ the rest of CompartmentOptions.

Testing Considerations

This has tests which cover both load and loadNow cases.

Compatibility Considerations

non-breaking

Upgrade Considerations

  • [ ] Update NEWS.md for user-facing changes.

boneskull avatar May 28 '25 00:05 boneskull