gf3 / Jerk

Stupidly simple IRC bots in Javascript.
http://gf3.github.com/Jerk
The Unlicense
106 stars 17 forks source link

A bug in error handling in connect #16

Open jsyrjala opened 13 years ago

jsyrjala commented 13 years ago

I am getting this stack trace when I accidentally set server name to x127.0.0.1.

There is a bug in error handling on connect, writing to console throws an exception.

If I replace message.params[0] with just message I get following error message:

There was an error! "Error: ENOTFOUND, Domain name not found"

/home/jsyrjala/node_modules/jerk/lib/jerk.js:39
        console.log( 'There was an error! "' + message.params[0] + '"' )
                                                             ^
TypeError: Cannot read property '0' of undefined
    at IRC.<anonymous> (/home/jsyrjala/node_modules/jerk/lib/jerk.js:39:62)
    at EventEmitter.<anonymous> (native)
    at EventEmitter.emit (events.js:64:17)
    at Socket.<anonymous> (/home/jsyrjala/node_modules/jerk/node_modules/irc-js/lib/irc.js:172:17)
    at Socket.emit (events.js:64:17)
    at net.js:720:14
    at dns.js:198:11
    at IOWatcher.callback (dns.js:74:15)
jsyrjala commented 13 years ago

See pull request https://github.com/gf3/Jerk/pull/17