lib/createWorkers.js
function _validateMessage(validate, message) {
    const { workerName } = configuration;
    try {
      return validate(message);
    } catch (err) {
      _emit(TASK_FAILED);
      logger.warn(
        { err, message, options: configWithoutFuncs, workerName },
        '[worker#listen] Message validation failed'
      );
      return err;
    }
  }
function _validateMessage(validate, message) {
    const { workerName } = configuration;
    try {
      return validate(message);
    } catch (err) {
      _emit(TASK_FAILED);
      logger.warn(
        { err, message, options: configWithoutFuncs, workerName },
        '[worker#listen] Message validation failed'
      );
      return err;
    }
  }
function _validateMessage ( validate , message ) { const { workerName } = configuration ; try { return validate ( message ) ; } catch ( err ) { _emit ( TASK_FAILED ) ; logger . warn ( { err , message , options : configWithoutFuncs , workerName } , '[worker#listen] Message validation failed' ) ; return err ; } }
Validate a message against custom validator if any

@param {function} validate the message validator
@param {String} message content of the message
@returns {Object|null} The validated object, or null if validation failed
@private
Validate a message against custom validator if any