summaryrefslogtreecommitdiffstats
path: root/matterclient
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-01-06 23:51:44 +0100
committerWim <wim@42.be>2017-01-06 23:51:44 +0100
commit77f1a959c3fa244fa4566335b87e428daf3614f4 (patch)
treeade7325716ab11e039b6e53fdb0fd3a0103bd3ce /matterclient
parente3dda0e812606e8d051567c401c139dc392706e1 (diff)
downloadmatterbridge-msglm-77f1a959c3fa244fa4566335b87e428daf3614f4.tar.gz
matterbridge-msglm-77f1a959c3fa244fa4566335b87e428daf3614f4.tar.bz2
matterbridge-msglm-77f1a959c3fa244fa4566335b87e428daf3614f4.zip
Handle errors in initUser()
Diffstat (limited to 'matterclient')
-rw-r--r--matterclient/matterclient.go15
1 files 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 {