Automatic Merge
Этот коммит содержится в:
Rodrigo Villablanca
2020-09-03 00:29:57 -04:00
коммит произвёл GitHub
родитель 953899ad95
Коммит 54f86e7fb1
29 изменённых файлов: 1131 добавлений и 616 удалений

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

@@ -475,7 +475,13 @@ func (s *SqlGroupStore) CreateGroupSyncable(groupSyncable *model.GroupSyncable)
switch groupSyncable.Type {
case model.GroupSyncableTypeTeam:
if _, err := s.Team().Get(groupSyncable.SyncableId); err != nil {
return nil, err
var nfErr *store.ErrNotFound
switch {
case errors.As(err, &nfErr):
return nil, model.NewAppError("CreateGroupSyncable", "app.team.get.find.app_error", nil, nfErr.Error(), http.StatusNotFound)
default:
return nil, model.NewAppError("CreateGroupSyncable", "app.team.get.finding.app_error", nil, err.Error(), http.StatusInternalServerError)
}
}
insertErr = s.GetMaster().Insert(groupSyncableToGroupTeam(groupSyncable))