[MM-57826] Make sure the original errors are wrapped when AppErrors are returned (#26771)

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Этот коммит содержится в:
Ben Schumacher
2024-04-22 12:03:28 +02:00
коммит произвёл GitHub
родитель 423809e0d0
Коммит 8348acac49
33 изменённых файлов: 132 добавлений и 132 удалений

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

@@ -249,9 +249,9 @@ func (a *App) RestoreGroup(groupID string) (*model.Group, *model.AppError) {
var nfErr *store.ErrNotFound
switch {
case errors.As(err, &nfErr):
return nil, model.NewAppError("RestoreGroup", "app.group.no_rows", nil, nfErr.Error(), http.StatusNotFound)
return nil, model.NewAppError("RestoreGroup", "app.group.no_rows", nil, "", http.StatusNotFound).Wrap(nfErr)
default:
return nil, model.NewAppError("RestoreGroup", "app.update_error", nil, err.Error(), http.StatusInternalServerError)
return nil, model.NewAppError("RestoreGroup", "app.update_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
}