mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-15 08:29:25 +01:00
Handle errors in initUser()
This commit is contained in:
parent
e3dda0e812
commit
77f1a959c3
@ -622,11 +622,20 @@ func (m *MMClient) initUser() error {
|
|||||||
//m.log.Debug("initUser(): loading all team data")
|
//m.log.Debug("initUser(): loading all team data")
|
||||||
for _, v := range initData.Teams {
|
for _, v := range initData.Teams {
|
||||||
m.Client.SetTeamId(v.Id)
|
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}
|
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)
|
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)
|
t.MoreChannels = mmchannels.Data.(*model.ChannelList)
|
||||||
m.OtherTeams = append(m.OtherTeams, t)
|
m.OtherTeams = append(m.OtherTeams, t)
|
||||||
if v.Name == m.Credentials.Team {
|
if v.Name == m.Credentials.Team {
|
||||||
|
Loading…
Reference in New Issue
Block a user