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, ",") {
|
for i, name := range strings.Split(namesStr, ",") {
|
||||||
uc, upstreamName, err := dc.unmarshalEntity(name)
|
uc, upstreamName, err := dc.unmarshalEntity(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ircError{&irc.Message{
|
return err
|
||||||
Command: irc.ERR_NOSUCHCHANNEL,
|
|
||||||
Params: []string{name, err.Error()},
|
|
||||||
}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var key string
|
var key string
|
||||||
@ -890,10 +887,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
|||||||
for _, name := range strings.Split(namesStr, ",") {
|
for _, name := range strings.Split(namesStr, ",") {
|
||||||
uc, upstreamName, err := dc.unmarshalEntity(name)
|
uc, upstreamName, err := dc.unmarshalEntity(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ircError{&irc.Message{
|
return err
|
||||||
Command: irc.ERR_NOSUCHCHANNEL,
|
|
||||||
Params: []string{name, err.Error()},
|
|
||||||
}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
params := []string{upstreamName}
|
params := []string{upstreamName}
|
||||||
|
Loading…
Reference in New Issue
Block a user