decodeErrorCommon = (errData, decodeRecur) => {
      const {
        errorId = undefined,
        message,
        name,
        cause = undefined,
        errors = undefined,
        ...rest
      } = errData;
      // See https://github.com/endojs/endo/pull/2052
      // capData does not transform strings. The immediately following calls
      // to `decodeRecur` are for reuse by other encodings that do,
      // such as smallcaps.
      const dName = decodeRecur(name);
      const dMessage = decodeRecur(message);
      // errorId is a late addition so be tolerant of its absence.
      const dErrorId = /** @type {string} */ (errorId && decodeRecur(errorId));
      if (typeof dName !== 'string') {
        throw Fail`invalid error name typeof ${q(typeof dName)}`;
      }
      if (typeof dMessage !== 'string') {
        throw Fail`invalid error message typeof ${q(typeof dMessage)}`;
      }
      const errConstructor = getErrorConstructor(dName) || Error;
      const errorName =
        dErrorId === undefined
          ? `Remote${errConstructor.name}`
          : `Remote${errConstructor.name}(${dErrorId})`;
      const options = {
        errorName,
        sanitize: false,
      };
      if (cause) {
        options.cause = decodeRecur(cause);
      }
      if (errors) {
        options.errors = decodeRecur(errors);
      }
      const rawError = makeError(dMessage, errConstructor, options);
      // Note that this does not decodeRecur rest's property names.
      // This would be inconsistent with smallcaps' expected handling,
      // but is fine here since it is only used for `annotateError`,
      // which is for diagnostic info that is otherwise unobservable.
      const descs = objectMap(rest, data => ({
        value: decodeRecur(data),
        writable: false,
        enumerable: false,
        configurable: false,
      }));
      defineProperties(rawError, descs);
      harden(rawError);
      return toPassableError(rawError);
    }
@param {{
  errorId?: string,
  message: string,
  name: string,
  cause: unknown,
  errors: unknown,
}} errData
@param {(e: unknown) => Passable} decodeRecur
@returns {Error}