Pull reconnect code out of main(), add missing params and error handling

This commit is contained in:
khlieng 2015-02-15 23:44:07 +01:00
parent 6e223c172f
commit ae78ac5017
2 changed files with 38 additions and 27 deletions

View file

@ -85,7 +85,8 @@ func handleWS(ws *websocket.Conn) {
irc.Password = data.Password
irc.Realname = data.Realname
if err := irc.Connect(data.Server); err != nil {
err := irc.Connect(data.Server)
if err != nil {
session.sendError(err, irc.Host)
log.Println(err)
} else {