1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 18:10:49 +09:00

GO-2827: Use std errors.Join

This commit is contained in:
Sergey 2024-06-12 10:09:03 +02:00
parent 9ef26cfe62
commit a9d457a54e
No known key found for this signature in database
GPG key ID: 3B6BEF79160221C6

View file

@ -11,7 +11,6 @@ import (
"github.com/anyproto/any-sync/commonfile/fileproto/fileprotoerr"
"github.com/anyproto/any-sync/commonspace/spacestorage"
"github.com/anyproto/any-sync/net/peer"
"github.com/hashicorp/go-multierror"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/samber/lo"
@ -188,7 +187,7 @@ func (s *fileSync) UploadSynchronously(ctx context.Context, spaceId string, file
}
func (s *fileSync) runOnUploadedHook(fileObjectId string, fileId domain.FullFileId) error {
var merr multierror.Error
var errs error
for _, hook := range s.onUploaded {
err := hook(fileObjectId, fileId)
if err != nil {
@ -199,10 +198,10 @@ func (s *fileSync) runOnUploadedHook(fileObjectId string, fileId domain.FullFile
zap.String("fileId", fileId.FileId.String()),
zap.Error(err))
}
merr.Errors = append(merr.Errors, err)
errs = errors.Join(errs, err)
}
}
return merr.ErrorOrNil()
return errs
}
func (s *fileSync) runOnUploadStartedHook(fileObjectId string, fileId domain.FullFileId) error {