message: wrap ws.send in try/catch
diff: @@ -131,11 +131,15 @@ function SocketBot(configuration) {
  bot.send = function(message, cb) {
  if (bot.connected || !bot.ws) {
  if (bot.ws) {
  + try {
  bot.ws.send(JSON.stringify(message), function(err) {
  if (cb) {
  return cb(err, message);
  }
  });
  + } catch (err) {
  + return cb(err);
  + }
  } else {
  try {
  bot.http_response.json(message);
  @@ -159,6 +163,7 @@ function SocketBot(configuration) {
  bot.startTyping = function() {
  if (bot.connected) {
  + try {
  bot.ws.send(JSON.stringify({
  type: 'typing'
  }), function(err) {
  @@ -166,6 +171,9 @@ function SocketBot(configuration) {
  console.error('startTyping failed: ' + err.message);
  }
  });
  + } catch (err) {
  + console.error('startTyping failed: ', err);
  + }
  }
  };
  