more idiomatic error handling
This commit is contained in:
parent
a4e7d876cc
commit
59a37b975c
@ -185,12 +185,13 @@ func (this *HubConnection) processProtocolMessage(message string) {
|
|||||||
case "$MyINFO":
|
case "$MyINFO":
|
||||||
u := UserInfo{}
|
u := UserInfo{}
|
||||||
err := u.fromMyINFO(commandParts[1])
|
err := u.fromMyINFO(commandParts[1])
|
||||||
if err == nil {
|
if err != nil {
|
||||||
this.userJoined_Full(&u)
|
|
||||||
} else {
|
|
||||||
this.processEvent(HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: err.Error()})
|
this.processEvent(HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: err.Error()})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.userJoined_Full(&u)
|
||||||
|
|
||||||
case "$NickList":
|
case "$NickList":
|
||||||
nicklist := strings.Split(commandParts[1], "$$")
|
nicklist := strings.Split(commandParts[1], "$$")
|
||||||
for _, nick := range nicklist {
|
for _, nick := range nicklist {
|
||||||
|
Loading…
Reference in New Issue
Block a user