diff --git a/pkg/api/api.go b/pkg/api/api.go index 0d97a2abf0b..478c253cebb 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -801,15 +801,11 @@ func (p *putterSessionWrapper) Put(ctx context.Context, chunk swarm.Chunk) error } func (p *putterSessionWrapper) Done(ref swarm.Address) error { - err := p.PutterSession.Done(ref) - if err != nil { - return err - } - return p.save() + return errors.Join(p.PutterSession.Done(ref), p.save()) } func (p *putterSessionWrapper) Cleanup() error { - return p.PutterSession.Cleanup() + return errors.Join(p.PutterSession.Cleanup(), p.save()) } func (s *Service) getStamper(batchID []byte) (postage.Stamper, func() error, error) {