xmppjs / hubot-xmpp

XMPP adapter for Hubot
181 stars 101 forks source link

Doesn't gracefully handle the absence of environment variables #105

Closed strugee closed 8 years ago

strugee commented 8 years ago

If you run a Hubot with this adapter and don't define all the required environment variables, you get:

TypeError: Cannot call method 'split' of undefined
  at XmppBot.run (/usr/local/lib/hubot/node_modules/hubot-xmpp/src/xmpp.coffee:29:54, <js>:48:61)
  at Robot.run (/usr/local/lib/hubot/node_modules/hubot/src/robot.coffee:588:5, <js>:461:27)
  at Object.<anonymous> (/usr/local/lib/hubot/node_modules/hubot/bin/hubot:137:8, <js>:150:11)
  at Object.<anonymous> (/usr/local/lib/hubot/node_modules/hubot/bin/hubot:5:1, <js>:153:4)
  at Module._compile (module.js:456:26)

It would be nice if there was a prettier error message that explained what was going on. As it is, this is pretty hard to debug.