error(e, groups = [], errorPort = 'error', scope = null) {
    const outPort = /** @type {OutPort} */ (this.outPorts.ports[errorPort]);
    if (outPort
      && (outPort.isAttached() || !outPort.isRequired())) {
      groups.forEach((group) => {
        outPort.openBracket(group, { scope });
      });
      outPort.data(e, { scope });
      groups.forEach((group) => {
        outPort.closeBracket(group, { scope });
      });
      return;
    }
    throw e;
  }
@param {Error} e
@param {Array<string>} [groups]
@param {string} [errorPort]
@param {string | null} [scope]