diff --git a/upstream.go b/upstream.go index a0f5d69..4d93221 100644 --- a/upstream.go +++ b/upstream.go @@ -1335,6 +1335,11 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { // Ignore case irc.RPL_STATSVLINE, rpl_statsping, irc.RPL_STATSBLINE, irc.RPL_STATSDLINE: // Ignore + case irc.ERR_PASSWDMISMATCH, irc.ERR_ERRONEUSNICKNAME, irc.ERR_NICKNAMEINUSE, irc.ERR_NICKCOLLISION, irc.ERR_UNAVAILRESOURCE: + if !uc.registered { + return fmt.Errorf("registration failed: %v", msg.Params[len(msg.Params) - 1]) + } + fallthrough default: uc.logger.Printf("unhandled message: %v", msg) if downstreamID != 0 {