Skip to content

Commit

Permalink
fixup! review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
erights authored and kriskowal committed Feb 22, 2024
1 parent a5d12f2 commit 45fafbc
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 26 deletions.
4 changes: 2 additions & 2 deletions packages/common/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
User-visible changes in `@endo/common`:

# next release
# Next release

- Change to `throwLabeled`
- `throwLabeled` parameterized error construction
- Like the assertion functions/methods that were parameterized by an error
constructor (`makeError`, `assert`, `assert.fail`, `assert.equal`),
`throwLabeled` now also accepts named options `cause` and `errors` in its
Expand Down
2 changes: 1 addition & 1 deletion packages/errors/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
User-visible changes in `@endo/errors`:

# next release
# Next release

- `AggegateError` support
- Assertion functions/methods that were parameterized by an error constructor
Expand Down
2 changes: 1 addition & 1 deletion packages/marshal/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
User-visible changes in `@endo/marshal`:

# next release
# Next release

- Sending and receiving extended errors.
- As of the previous release, `@endo/marshal` tolerates extra error
Expand Down
16 changes: 4 additions & 12 deletions packages/marshal/test/test-marshal-capdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ test('unserialize extended errors', t => {
t.false('extraProp' in refErr);
t.false('cause' in refErr);
t.false('errors' in refErr);
console.log('error with extra prop', refErr);

const aggErr = uns(
'{"@qclass":"error","message":"msg","name":"AggregateError","extraProp":"foo","cause":"bar","errors":["zip","zap"]}',
Expand All @@ -177,7 +176,6 @@ test('unserialize extended errors', t => {
t.false('extraProp' in aggErr);
t.false('cause' in aggErr);
t.is(aggErr.errors.length, 0);
console.log('error with extra prop', aggErr);

const unkErr = uns(
'{"@qclass":"error","message":"msg","name":"UnknownError","extraProp":"foo","cause":"bar","errors":["zip","zap"]}',
Expand All @@ -186,14 +184,12 @@ test('unserialize extended errors', t => {
t.false('extraProp' in unkErr);
t.false('cause' in unkErr);
t.false('errors' in unkErr);
console.log('error with extra prop', unkErr);
});

test('unserialize errors w recognized extensions', t => {
if (typeof AggregateError === 'undefined') {
t.pass('skip test on platforms prior to AggregateError');
return;
}
const testIfAggregateError =
typeof AggregateError !== 'undefined' ? test : test.skip;

testIfAggregateError('unserialize errors w recognized extensions', t => {
const { unserialize } = makeTestMarshal();
const uns = body => unserialize({ body, slots: [] });

Expand All @@ -206,7 +202,6 @@ test('unserialize errors w recognized extensions', t => {
t.false('extraProp' in refErr);
t.is(getPrototypeOf(refErr.cause), URIError.prototype);
t.is(getPrototypeOf(refErr.errors[0]), URIError.prototype);
console.log('error with extra prop', refErr);

const aggErr = uns(
`{"@qclass":"error","message":"msg","name":"AggregateError","extraProp":"foo","cause":${errEnc},"errors":[${errEnc}]}`,
Expand All @@ -215,7 +210,6 @@ test('unserialize errors w recognized extensions', t => {
t.false('extraProp' in aggErr);
t.is(getPrototypeOf(aggErr.cause), URIError.prototype);
t.is(getPrototypeOf(aggErr.errors[0]), URIError.prototype);
console.log('error with extra prop', aggErr);

const unkErr = uns(
`{"@qclass":"error","message":"msg","name":"UnknownError","extraProp":"foo","cause":${errEnc},"errors":[${errEnc}]}`,
Expand All @@ -224,8 +218,6 @@ test('unserialize errors w recognized extensions', t => {
t.false('extraProp' in unkErr);
t.is(getPrototypeOf(unkErr.cause), URIError.prototype);
t.is(getPrototypeOf(unkErr.errors[0]), URIError.prototype);

console.log('error with extra prop', unkErr);
});

test('passStyleOf null is "null"', t => {
Expand Down
6 changes: 0 additions & 6 deletions packages/marshal/test/test-marshal-smallcaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ test('smallcaps unserialize extended errors', t => {
t.false('extraProp' in refErr);
t.false('cause' in refErr);
t.false('errors' in refErr);
console.log('error with extra prop', refErr);

const aggErr = uns(
'#{"#error":"msg","name":"AggregateError","extraProp":"foo","cause":"bar","errors":["zip","zap"]}',
Expand All @@ -183,7 +182,6 @@ test('smallcaps unserialize extended errors', t => {
t.false('extraProp' in aggErr);
t.false('cause' in aggErr);
t.is(aggErr.errors.length, 0);
console.log('error with extra prop', aggErr);

const unkErr = uns(
'#{"#error":"msg","name":"UnknownError","extraProp":"foo","cause":"bar","errors":["zip","zap"]}',
Expand All @@ -192,7 +190,6 @@ test('smallcaps unserialize extended errors', t => {
t.false('extraProp' in unkErr);
t.false('cause' in unkErr);
t.false('errors' in unkErr);
console.log('error with extra prop', unkErr);
});

test('smallcaps unserialize errors w recognized extensions', t => {
Expand All @@ -212,7 +209,6 @@ test('smallcaps unserialize errors w recognized extensions', t => {
t.false('extraProp' in refErr);
t.is(getPrototypeOf(refErr.cause), URIError.prototype);
t.is(getPrototypeOf(refErr.errors[0]), URIError.prototype);
console.log('error with extra prop', refErr);

const aggErr = uns(
`#{"#error":"msg","name":"AggregateError","extraProp":"foo","cause":${errEnc},"errors":[${errEnc}]}`,
Expand All @@ -221,7 +217,6 @@ test('smallcaps unserialize errors w recognized extensions', t => {
t.false('extraProp' in aggErr);
t.is(getPrototypeOf(refErr.cause), URIError.prototype);
t.is(getPrototypeOf(refErr.errors[0]), URIError.prototype);
console.log('error with extra prop', aggErr);

const unkErr = uns(
`#{"#error":"msg","name":"UnknownError","extraProp":"foo","cause":${errEnc},"errors":[${errEnc}]}`,
Expand All @@ -230,7 +225,6 @@ test('smallcaps unserialize errors w recognized extensions', t => {
t.false('extraProp' in unkErr);
t.is(getPrototypeOf(refErr.cause), URIError.prototype);
t.is(getPrototypeOf(refErr.errors[0]), URIError.prototype);
console.log('error with extra prop', unkErr);
});

test('smallcaps mal-formed @qclass', t => {
Expand Down
2 changes: 1 addition & 1 deletion packages/pass-style/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
User-visible changes in `@endo/pass-style`:

# next release
# Next release

- Now supports `AggegateError`, `error.errors`, `error.cause`.
- A `Passable` error can now include an `error.cause` property whose
Expand Down
4 changes: 3 additions & 1 deletion packages/pass-style/src/passStyleOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ harden(assertPassable);
*
* TODO Deprecate and ultimately delete @agoric/base-zone's `isPassable' in
* favor of this one.
* See https://github.com/endojs/endo/issues/2096
*
* TODO implement an isPassable that does not rely on try/catch.
* This implementation is just a standin until then
* This implementation is just a standin until then.
* See https://github.com/endojs/endo/issues/2096
*
* @param {any} specimen
* @returns {specimen is Passable}
Expand Down
2 changes: 1 addition & 1 deletion packages/patterns/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
User-visible changes in `@endo/patterns`:

# next release
# Next release

- Add `M.tagged(tagPattern, payloadPattern)` for making patterns that match
Passable Tagged objects.
Expand Down
2 changes: 1 addition & 1 deletion packages/ses/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
User-visible changes in SES:

# next release
# Next release

- Now supports `Promise.any`, `AggegateError`, `error.errors`,
and `error.cause`.
Expand Down

0 comments on commit 45fafbc

Please sign in to comment.