Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing @endo/errors without importing SES #2319

Open
turadg opened this issue Jun 12, 2024 · 1 comment
Open

importing @endo/errors without importing SES #2319

turadg opened this issue Jun 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@turadg
Copy link
Member

turadg commented Jun 12, 2024

What is the Problem Being Solved?

The assertion functions from SES are used by libraries such as @agoric/ertp. When one imports, say AmountMath, it's surprising to find that it fails unless you also init SES first. There's also no feedback about the problem or solution, just a failure to find the global assert.

Description of the Design

Migrate downstream clients to use @endo/errors instead of the global assert. E.g. Agoric/agoric-sdk#5672

Make @endo/errors exports work without having initialized SES

Security Considerations

Scaling Considerations

Test Plan

Compatibility Considerations

Upgrade Considerations

@turadg turadg added the enhancement New feature or request label Jun 12, 2024
@kriskowal
Copy link
Member

kriskowal commented Jun 21, 2024

Scaling and correctness considerations: Making @endo/errors work without ses running first means that anything using @endo/errors will entrain a copy of the assert internals of SES and will need to work if it is an eval twin of the globalThis.assert provided by SES, such that the tamed global console provided by ses can still unredact errors emitted by the @endo/errors eval twin. We may be able to mitigate this by allowing bundles to exit to a endo:assert host module if they are bundled in the presence of the "endo" tag for purposes of package conditional imports/exports like #1625.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants