Skip to content

Commit

Permalink
fixup: review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jan 27, 2024
1 parent 365ab3e commit acde7a3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/captp/src/captp.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Remotable, Far, makeMarshal, QCLASS } from '@endo/marshal';
import { E, HandledPromise } from '@endo/eventual-send';
import { isPromise, makePromiseKit } from '@endo/promise-kit';

import { X, Fail, errorNote } from '@endo/errors';
import { X, Fail, annotateError } from '@endo/errors';
import { makeTrap } from './trap.js';

import { makeFinalizingMap } from './finalize.js';
Expand Down Expand Up @@ -669,7 +669,7 @@ export const makeCapTP = (
if (!e) {
Fail`trapGuest expected trapHost AsyncIterator(${questionID}) to be done, but it wasn't`;
}
errorNote(e, X`trapHost AsyncIterator(${questionID}) threw`);
annotateError(e, X`trapHost AsyncIterator(${questionID}) threw`);
throw e;
}
};
Expand Down
4 changes: 2 additions & 2 deletions packages/common/throw-labeled.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { X, makeError, errorNote } from '@endo/errors';
import { X, makeError, annotateError } from '@endo/errors';

/**
* Given an error `innerErr` and a `label`, throws a similar
Expand All @@ -15,7 +15,7 @@ export const throwLabeled = (innerErr, label, ErrorConstructor = undefined) => {
label = `[${label}]`;
}
const outerErr = makeError(`${label}: ${innerErr.message}`, ErrorConstructor);
errorNote(outerErr, X`Caused by ${innerErr}`);
annotateError(outerErr, X`Caused by ${innerErr}`);
throw outerErr;
};
harden(throwLabeled);
2 changes: 1 addition & 1 deletion packages/errors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ export {
quote as q,
redacted as X,
throwRedacted as Fail,
note as errorNote,
note as annotateError,
};
4 changes: 2 additions & 2 deletions packages/marshal/src/marshal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
hasOwnPropertyOf,
} from '@endo/pass-style';

import { X, Fail, q, makeError, errorNote } from '@endo/errors';
import { X, Fail, q, makeError, annotateError } from '@endo/errors';
import {
QCLASS,
makeEncodeToCapData,
Expand Down Expand Up @@ -124,7 +124,7 @@ export const makeMarshal = (
// with the correlation.
const errorId = encodeRecur(nextErrorId());
assert.typeof(errorId, 'string');
errorNote(err, X`Sent as ${errorId}`);
annotateError(err, X`Sent as ${errorId}`);
marshalSaveError(err);
return harden({ errorId, message, name });
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/marshal/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export {};
* identify the sending of errors relative to this marshal instance.
* @property {(err: Error) => void=} marshalSaveError If `errorTagging` is
* `'on'`, then errors serialized by this marshal instance are also
* logged by calling `marshalSaveError` *after* `errorNote` associated
* logged by calling `marshalSaveError` *after* `annotateError` associated
* that error with its errorId. Thus, if `marshalSaveError` in turn logs
* to the normal console, which is the default, then the console will
* show that note showing the associated errorId.
Expand Down
4 changes: 2 additions & 2 deletions packages/pass-style/src/error.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="ses"/>

import { X, Fail, errorNote } from '@endo/errors';
import { X, Fail, annotateError } from '@endo/errors';
import { assertChecker } from './passStyle-helpers.js';

/** @typedef {import('./internal-types.js').PassStyleHelper} PassStyleHelper */
Expand Down Expand Up @@ -116,7 +116,7 @@ export const toPassableError = err => {
// Even the cleaned up error copy, if sent to the console, should
// cause hidden diagnostic information of the original error
// to be logged.
errorNote(newError, X`copied from error ${err}`);
annotateError(newError, X`copied from error ${err}`);
return newError;
};
harden(toPassableError);
4 changes: 2 additions & 2 deletions packages/patterns/src/patterns/patternMatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { applyLabelingError } from '@endo/common/apply-labeling-error.js';
import { fromUniqueEntries } from '@endo/common/from-unique-entries.js';
import { listDifference } from '@endo/common/list-difference.js';

import { q, b, X, Fail, makeError, errorNote } from '@endo/errors';
import { q, b, X, Fail, makeError, annotateError } from '@endo/errors';
import { keyEQ, keyGT, keyGTE, keyLT, keyLTE } from '../keys/compareKeys.js';
import {
assertKey,
Expand Down Expand Up @@ -590,7 +590,7 @@ const makePatternKit = () => {
X`internal: ${label}: inconsistent pattern match: ${q(patt)}`,
);
if (innerError !== undefined) {
errorNote(outerError, X`caused by ${innerError}`);
annotateError(outerError, X`caused by ${innerError}`);
}
throw outerError;
};
Expand Down

0 comments on commit acde7a3

Please sign in to comment.