Open turadg opened 5 months ago
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.
What is the Problem Being Solved?
The assertion functions from SES are used by libraries such as
@agoric/ertp
. When one imports, sayAmountMath
, 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 globalassert
.Description of the Design
Migrate downstream clients to use
@endo/errors
instead of the globalassert
. E.g. https://github.com/Agoric/agoric-sdk/issues/5672Make
@endo/errors
exports work without having initialized SESSecurity Considerations
Scaling Considerations
Test Plan
Compatibility Considerations
Upgrade Considerations