From 77f1a959c3fa244fa4566335b87e428daf3614f4 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 6 Jan 2017 23:51:44 +0100 Subject: Handle errors in initUser() --- matterclient/matterclient.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index 70493693..b860ec80 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -622,11 +622,20 @@ func (m *MMClient) initUser() error { //m.log.Debug("initUser(): loading all team data") for _, v := range initData.Teams { m.Client.SetTeamId(v.Id) - mmusers, _ := m.Client.GetProfiles(0, 50000, "") + mmusers, err := m.Client.GetProfiles(0, 50000, "") + if err != nil { + return errors.New(err.DetailedError) + } t := &Team{Team: v, Users: mmusers.Data.(map[string]*model.User), Id: v.Id} - mmchannels, _ := m.Client.GetChannels("") + mmchannels, err := m.Client.GetChannels("") + if err != nil { + return errors.New(err.DetailedError) + } t.Channels = mmchannels.Data.(*model.ChannelList) - mmchannels, _ = m.Client.GetMoreChannels("") + mmchannels, err = m.Client.GetMoreChannels("") + if err != nil { + return errors.New(err.DetailedError) + } t.MoreChannels = mmchannels.Data.(*model.ChannelList) m.OtherTeams = append(m.OtherTeams, t) if v.Name == m.Credentials.Team { -- cgit v1.2.3