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:
parent
d00698e15c
commit
9b7309d4c9
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user