docs: function extractMessagesFromStreamEventRecord(record, batch, extractMessagesFromRecord, extractMessageFromRecord, context) {
    if (!record || typeof record !== 'object') {
      context.warn(`Adding invalid record (${record}) as an unusable record`);
      return Promise.resolve([{unusableRec: batch.addUnusableRecord(record, undefined, `invalid record (${record})`, context)}]);
    }
  
    // Validate the record
    const kinesisStreamType = isKinesisStreamType(context);
    try {
      if (kinesisStreamType) {
        streamEvents.validateKinesisStreamEventRecord(record);
      } else if (isDynamoDBStreamType(context)) {
        streamEvents.validateDynamoDBStreamEventRecord(record);
      } else {
        // Record is neither a Kinesis nor a DynamoDB stream event record, so return no message, no promises and the unusable record
        const errMsg = `Record is neither a Kinesis nor a DynamoDB stream event record - unexpected stream type (${Settings.getStreamType(context)})`;
        context.error(errMsg);
        return Promise.resolve([{unusableRec: batch.addUnusableRecord(record, undefined, errMsg, context)}]);
      }
    } catch (err) {
      context.error(err);
      return Promise.resolve([{unusableRec: batch.addUnusableRecord(record, undefined, err.message, context)}]);
    }
  
    // Extract the message(s) from the record using the configured `extractMessagesFromRecord` function
    return Promises.try(() => extractMessagesFromRecord(record, batch, extractMessageFromRecord, context)).then(
      results => {
        if (context.traceEnabled) {
          let m = 0, rm = 0, u = 0;
          results.forEach(r => {
            if (r) {
              if (r.msg) ++m;
              else if (r.rejectedMsg) ++rm;
              else if (r.unusableRec) ++u;
            }
          });
          const mru = `${m} message${m !== 1 ? 's' : ''}, ${rm} rejected message${rm !== 1 ? 's' : ''} & ${u} unusable record${u !== 1 ? 's' : ''}`;
          context.trace(`Extracted ${mru} from record (${record && record.eventID})`);
        }
        return results;
      },
      err => {
        // Promise rejected with an error
        context.error(`Failed to extract messages from record (${record && record.eventID})`, err);
        if (isInstanceOf(err, FatalError)) {
          throw err; // rethrow any FatalError
        }
        // NB: Do NOT throw an error in a non-fatal case, since an unparseable record will most likely remain an
        // unparseable record forever and throwing an error would result in an "infinite" loop back to the stream until
        // the record eventually expires
        return [{unusableRec: batch.addUnusableRecord(record, undefined, err.message, context)}];
      }
    );
  }