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":
|
||||
u := UserInfo{}
|
||||
err := u.fromMyINFO(commandParts[1])
|
||||
if err == nil {
|
||||
this.userJoined_Full(&u)
|
||||
} else {
|
||||
if err != nil {
|
||||
this.processEvent(HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
this.userJoined_Full(&u)
|
||||
|
||||
case "$NickList":
|
||||
nicklist := strings.Split(commandParts[1], "$$")
|
||||
for _, nick := range nicklist {
|
||||
|
Loading…
Reference in New Issue
Block a user