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

Features needed from Error + console + assert #440

Closed
erights opened this issue Aug 26, 2020 · 1 comment · Fixed by #447
Closed

Features needed from Error + console + assert #440

erights opened this issue Aug 26, 2020 · 1 comment · Fixed by #447
Assignees

Comments

@erights
Copy link
Contributor

erights commented Aug 26, 2020

See Agoric/agoric-sdk#1619

First, need to move assert package from agoric-sdk to SES-shim.

Combine error taming, console taming + features, and assert into a new a group that shares some hidden state.

If we can break up the error taming into a minimal first error taming to be safe (which might be the current one) and once SES supports vetted shims, we might make this triple an enhanced error,console,assert shim that replaces the tamed error. That would let us cleanly move it into its own package, and to omit it from minimal SES configurations.

The agoric-sdk assert package currently logs the actual data from the details template literal to the console when the error is thrown. Rather, in a manner similar to how the error-repair uses a weakmap on the side to associate stack trace info with an error, assert could likewise do so with the data from the details template literal. It should delay rendering this diagnostic data until that error is sent back to the console.

Our enhanced console, when getting an error object, should render any stack trace it held on the side in that weakmap, emulating the current de-facto typical console behavior on untamed errors, while keeping the stack hidden to those that just have the error. The old Caja/SES error taming did this.

Likewise, when getting an error object, our enhanced console should render the full details info it had kept on the side, if any, which keeping that data hidden.

It would generally be good to ask the console to associate hidden info with an error, to be rendered to the console only when the error is rendered. This would require adding a new non-standard api, perhaps to our console object. With such a generally available api, the new assert package would not need a special arrangement.

This could be used to keep stack traces associated with passed errors. Errors are passed by copy between mutually suspicious machines. Therefore anything hidden cannot be sent. The answer (with echoes in Causeway) is that the marshal layer on the sending side logs the error that it is sending, together with an extra marshal-generated identifier that it also sends in the serialized error record. The marshal on the receiving side asks its own console to associate this identifier with the received error. Someone, or some tool, that is given access to both logs can stitch them together --- can find the sending-side stack trace log that it uses to diagnose the stackless error as received.

@erights
Copy link
Contributor Author

erights commented Aug 26, 2020

See #324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant