Simplify error handling for downstream JOIN/PART

downstreamConnection.unmarshalEntity already returns an ircError of
command ERR_NOSUCHCHANNEL, so there's no need to explicitly return
another ircError of that type.
This commit is contained in:
delthas 2020-03-25 23:56:01 +01:00 committed by Simon Ser
parent d00698e15c
commit 9b7309d4c9
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 2 additions and 8 deletions

View File

@ -848,10 +848,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
for i, name := range strings.Split(namesStr, ",") {
uc, upstreamName, err := dc.unmarshalEntity(name)
if err != nil {
return ircError{&irc.Message{
Command: irc.ERR_NOSUCHCHANNEL,
Params: []string{name, err.Error()},
}}
return err
}
var key string
@ -890,10 +887,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
for _, name := range strings.Split(namesStr, ",") {
uc, upstreamName, err := dc.unmarshalEntity(name)
if err != nil {
return ircError{&irc.Message{
Command: irc.ERR_NOSUCHCHANNEL,
Params: []string{name, err.Error()},
}}
return err
}
params := []string{upstreamName}