When handling a message we use a controller

@param {Message} message
@throws Error
775465
function Controller (message) {

  if (!(message instanceof Message)) throw new Error('message must be an instanceof Message');

  if (!(this instanceof Controller)) return new Controller(message);

  debug('new controller');

  events.EventEmitter.call(this);

  this.message = message;

  this.data = this.message.data;

}
895290
public void error(String message, Object ... args) {
    if (log.isErrorEnabled()) {
      log.error(String.format(message, args));
    }
  }
856463
function(message) {
            if(!aborted) {
                message = typeof message == 'string' ? message : 'Connection aborted';
                promise.abort();
                promise(false, [new Error(message), xhr, null]);
            }
        }
1245072
function (message) {
        if (this.isEnabled(Level.DEBUG)) {
            console.debug.apply(console, logArgs(Level.DEBUG, this.category, arguments));
        }
    }
1090515
function(message, level) {
            level = level || Base.LOGLEVEL.INFO;

            if (message instanceof Error) {
                message = message.toString() + (message.stack || "");
            }

            if (Base.logger.length) {
                for (var i = 0; i < Base.logger.length; i++) {
                    Base.logger[i].log(message, level);
                }
            } else if (typeof console !== "undefined") {
                var method = (console[level] || console.log);
                if(method){
                    try {
                        method.call(console, "[ " + (new Date()) + " ]: ", message);
                    } catch (e) {
                        // nothing to do here
                    }
                }
            }
        }
520108
function onMessage(message) {
  if (message.command === 'run') {
    run(message.opts);
    return;
  }

  if (message.command === 'stop') {
    cleanup();
  }
}
688221
function RequestSSLError(message, id) {
	Error.call(this);
	Error.captureStackTrace(this, RequestSSLError);
	this.id = id;
	this.name = 'RequestSSLError';
	this.message = message;
}
1149537
function validatorError( message , element ) {
	var error = new doormen.ValidatorError( message , element ) ;

	this.validate = false ;

	if ( this.report ) {
		this.errors.push( error ) ;
	}
	else {
		throw error ;
	}
}
950011
function(message, index) {
			var error = new Error(message + ' at character ' + index);
			error.index = index;
			error.description = message;
			throw error;
		}
49749
function (message, err) {
  if(!(this instanceof )) {
    return new (message, err);
  }
  BaseError.call(this, message, err);
}
680333
function(message){
			document.getElementById('messageLabel').classList.add("errorMessage"); //$NON-NLS-0$ //$NON-NLS-1$
			document.getElementById('messageContainer').classList.add("errorMessage"); //$NON-NLS-0$ //$NON-NLS-1$
			lib.empty(document.getElementById('messageText')); //$NON-NLS-0$
			
			document.getElementById('messageText').style.width = "calc(100% - 10px)"; //$NON-NLS-0$ //$NON-NLS-1$
			document.getElementById('messageText').appendChild(WizardUtils.defaultParseMessage(message)); //$NON-NLS-0$
			lib.empty(document.getElementById('messageButton')); //$NON-NLS-0$
			
			document.getElementById('messageButton').className = "dismissButton core-sprite-close imageSprite"; //$NON-NLS-0$ //$NON-NLS-1$
			document.getElementById('messageButton').onclick = WizardUtils.defaultHideMessage; //$NON-NLS-0$
			document.getElementById('messageContainer').classList.add("showing"); //$NON-NLS-0$ //$NON-NLS-1$
		}
373773
function NameError(message) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'Middleware Name Error';
  this.message = message || 'The argument must be a named function or supply a name';
}
341853
function _onMessage(message) {
        var response    = JSON.parse(message.data),
            msgRecord   = _messageCallbacks[response.id],
            callback    = msgRecord && msgRecord.callback,
            msgText     = (msgRecord && msgRecord.message) || "No message";

        if (msgRecord) {
            // Messages with an ID are a response to a command, fire callback
            callback(response.result, response.error);
            delete _messageCallbacks[response.id];
        } else if (response.method) {
            // Messages with a method are an event, trigger event handlers
            var domainAndMethod = response.method.split("."),
                domain = domainAndMethod[0],
                method = domainAndMethod[1];

            EventDispatcher.triggerWithArray(exports[domain], method, response.params);
        }

        // Always fire event handlers for all messages/errors
        exports.trigger("message", response);

        if (response.error) {
            exports.trigger("error", response.error, msgText);
        }
    }
1262089
function handleMessage(message) {
  var type = message.data.type;
  var id = message.data.id;
  var payload = message.data.payload;
  switch(type) {
    case 'load-index':
      makeRequest(SEARCH_TERMS_URL, function(searchInfo) {
        index = createIndex(loadIndex(searchInfo));
        self.postMessage({type: type, id: id, payload: true});
      });
      break;
    case 'query-index':
      self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}});
      break;
    default:
      self.postMessage({type: type, id: id, payload: {error: 'invalid message type'}})
  }
}
220787
function Message(message, headers, deliveryInfo, obj) {
  // Crane uses slash ('/') separators rather than period ('.')
  this.topic = deliveryInfo.routingKey.replace(/\./g, '/');
  this.headers = headers;
  if (deliveryInfo.contentType) { this.headers['content-type'] = deliveryInfo.contentType; }
  
  if (Buffer.isBuffer(message.data)) {
    this.data = message.data;
  } else {
    this.body = message;
  }
  
  this.__msg = obj;
}
1098032
protected void fireMPDErrorEvent(String message) {
        ErrorEvent ee = new ErrorEvent(this, message);

        for (ErrorListener el : errorListeners) {
            el.errorEventReceived(ee);
        }
    }
325988
function (error) {
        var message = 'ERROR';
        if (error.code) {
          message += ' - ' + error.code;
        }
        if (error.message) {
          message += ' - ' + error.message.toString();
        }
        if (error.stack) {
          message += ' - ' + error.stack.toString();
        }
        this.send({
          ok: false,
          error: message
        });
      }