From 719886edd9dc121c92f6d4e14e811e7947c9e313 Mon Sep 17 00:00:00 2001 From: Alex Borodin Date: Tue, 28 Nov 2023 13:16:13 +0100 Subject: [PATCH] fix: add filename to error message on push fail where missing --- internal/app/cli/push.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/app/cli/push.go b/internal/app/cli/push.go index 76463b9c..daca53db 100644 --- a/internal/app/cli/push.go +++ b/internal/app/cli/push.go @@ -99,7 +99,7 @@ func pushFile(filename string, remote remotes.Remote, optPath string) (PushResul _, raw, err := internal.ReadRequiredFile(filename) if err != nil { Stderrf("Couldn't read file %s: %v", filename, err) - return PushResult{PushErr, err.Error()}, err + return PushResult{PushErr, fmt.Sprintf("error pushing file %s: %s", filename, err.Error())}, err } id, err := commands.PushFile(raw, remote, optPath) if err != nil { @@ -107,7 +107,7 @@ func pushFile(filename string, remote remotes.Remote, optPath string) (PushResul if errors.As(err, &errExists) { return PushResult{TMExists, fmt.Sprintf("file %s already exists as %s", filename, id.String())}, nil } - return PushResult{PushErr, err.Error()}, err + return PushResult{PushErr, fmt.Sprintf("error pushing file %s: %s", filename, err.Error())}, err } return PushResult{PushOK, fmt.Sprintf("file %s pushed as %s", filename, id.String())}, nil