more idiomatic error handling

This commit is contained in:
mappu 2017-02-08 18:57:49 +13:00
parent a4e7d876cc
commit 59a37b975c

View File

@ -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 {