From 0831dbe6f1fbb97d111c413976218387a5f3df02 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 13 Aug 2020 15:30:41 +0200 Subject: [PATCH] Handle upstream ERROR messages --- upstream.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/upstream.go b/upstream.go index 9d1252a..07d6266 100644 --- a/upstream.go +++ b/upstream.go @@ -1343,6 +1343,12 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { // Ignore case irc.RPL_STATSVLINE, rpl_statsping, irc.RPL_STATSBLINE, irc.RPL_STATSDLINE: // Ignore + case "ERROR": + var text string + if err := parseMessageParams(msg, &text); err != nil { + return err + } + return fmt.Errorf("fatal server error: %v", text) case irc.ERR_PASSWDMISMATCH, irc.ERR_ERRONEUSNICKNAME, irc.ERR_NICKNAMEINUSE, irc.ERR_NICKCOLLISION, irc.ERR_UNAVAILRESOURCE, irc.ERR_NOPERMFORHOST, irc.ERR_YOUREBANNEDCREEP: if !uc.registered { return fmt.Errorf("registration failed: %v", msg.Params[len(msg.Params)-1])