From d642e2cd62d7871e47635c8a7082db9634a4e683 Mon Sep 17 00:00:00 2001 From: reshke Date: Wed, 25 Sep 2024 15:33:44 +0500 Subject: [PATCH] Add logging of failed chunks transfer (#59) --- cmd/client/main.go | 2 +- pkg/proc/interaction.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index a715679..9463b67 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -92,7 +92,7 @@ func copyFunc(con net.Conn, instanceCnf *config.Instance, args []string) error { ansType, body, err := protoReader.ReadPacket() if err != nil { - ylogger.Zero.Debug().Err(err).Msg("error while ans") + ylogger.Zero.Debug().Err(err).Msg("error while answer") return err } diff --git a/pkg/proc/interaction.go b/pkg/proc/interaction.go index dbea442..3f93472 100644 --- a/pkg/proc/interaction.go +++ b/pkg/proc/interaction.go @@ -339,13 +339,13 @@ func ProcConn(s storage.StorageInteractor, cr crypt.Crypter, ycl client.YproxyCl } if _, err := io.Copy(writerToNewBucket, fromReader); err != nil { - ylogger.Zero.Error().Err(err).Msg("failed to copy data") + ylogger.Zero.Error().Str("path", path).Err(err).Msg("failed to copy data") failed = append(failed, objectMetas[i]) return } if err := writerToNewBucket.Close(); err != nil { - ylogger.Zero.Error().Err(err).Msg("failed to close writer") + ylogger.Zero.Error().Str("path", path).Err(err).Msg("failed to close writer") failed = append(failed, objectMetas[i]) return }