-
Notifications
You must be signed in to change notification settings - Fork 74
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
Combine error
taming, rich assert
, and console
virtualization
#447
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it’s starting well.
We will have to come up with a sensible way to use console
as a shim vs assert
as a module. There’s a tension there. It might be good to separate the layers such that assert
is a module that relies on the underlying console
for reporting.
Also, console
implementations do generally implement sprintf
style log
methods. We probably can and ought to respect those as valid ways to pronounce details
.
8d1e8d2
to
7fc7429
Compare
error
taming, rich assert
, and console
virtualizationerror
taming, rich assert
, and console
virtualization
Hi @kriskowal this is ready for review. However, in getting here, this got rather large. If you'd like, we should discuss how to break it up into reviewable-sized chunks. |
5a8fe20
to
97c7c3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a partial review. I am still digesting.
Capturing out-of-band feedback: I’m recommending that we use an API like } catch (error) {
assert.note(error, details`number too small ${num}`);
throw error;
} (Which I believe would be more palatable than Recommending that we use the catch-and-rethrow in SES module loading as a proving ground for this, and as an example of usage in this change. I retract my suggestion that we use the term |
I’m intrigued by the idea that the assertion library would provide “progressively enhanced” behavior depending on whether the I will look more closely at this change. I suspect that the untamed case would need a mechanism for correlating related log messages, perhaps using a sequential identifier. |
Ready for review! |
Adding @warner and leaving @michaelfig as optional reviewers. Only review from @kriskowal is critical. |
Done.
Still TODO. After this PR is merged but before integration?
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to at least discuss the proposed console
API extension. Apart from that, all remaining feedback is for your discretion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked carefully at the types, and from that standpoint, LGTM!
Ready for review again. For |
Nevermind. I squashed and both modules are new compared to master, leaving little choice but to compare entire files. My apologies; I should have squashed less aggressively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working in my feedback on the API. This seems better.
I am still concerned about the special relationship between assert
and console
. The console
gets constructed with view into a particular assert
module instance, but I expect each compartment will have its own assert
module instance and errors will be forwarded only to the root console
.
How do we ensure that details attached in a deeply nested compartment surface to the outermost console?
Back to draft until it is again ready for review. Please spend no more time reviewing the current state. |
120a1b5
to
cdc0a65
Compare
Ready for review again! Includes new design doc at https://github.com/Agoric/SES-shim/tree/console/packages/ses/src/error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with nits. Thanks!
@@ -0,0 +1,337 @@ | |||
// TODO The following two lines came from agoric-sdk with already supports ava. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you want me to do here. In moving this package from the agoric-sdk monorepo to the SES-shim monorepo, I had to regress the testing to use tap or tape rather than AVA. I put this comment there to help when we reverse this regression, once SES-shim switches to use AVA.
I'll leave this unresolved, but I am not inclined to postpone merging till we resolve this.
// This is just a token standalone test of the `assert` module. The real test | ||
// is in assert-log.test.js which also uses the logging console. | ||
|
||
// TODO The following line came from agoric-sdk which already supports ava. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise
Fixes #440