Migration of ChannelStore.GetMoreChannels to return plain error (#14811)

Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-06-19 14:26:35 -04:00
коммит произвёл GitHub
родитель 4a974eabea
Коммит d391fd6231
8 изменённых файлов: 20 добавлений и 18 удалений

Просмотреть файл

@@ -999,7 +999,7 @@ func (s SqlChannelStore) getAllChannelsQuery(opts store.ChannelSearchOpts, forCo
return query
}
func (s SqlChannelStore) GetMoreChannels(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) {
func (s SqlChannelStore) GetMoreChannels(teamId string, userId string, offset int, limit int) (*model.ChannelList, error) {
channels := &model.ChannelList{}
_, err := s.GetReplica().Select(channels, `
SELECT
@@ -1035,7 +1035,7 @@ func (s SqlChannelStore) GetMoreChannels(teamId string, userId string, offset in
})
if err != nil {
return nil, model.NewAppError("SqlChannelStore.GetMoreChannels", "store.sql_channel.get_more_channels.get.app_error", nil, "teamId="+teamId+", userId="+userId+", err="+err.Error(), http.StatusInternalServerError)
return nil, errors.Wrapf(err, "failed getting channels with teamId=%s and userId=%s", teamId, userId)
}
return channels, nil