From 34b0017f06a45e0147bb641435b5656e34279e6e Mon Sep 17 00:00:00 2001 From: Max Holland Date: Thu, 25 Jan 2024 16:11:09 +0000 Subject: [PATCH] Add URI to logs and errors for better debugging --- core/uploader.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/uploader.go b/core/uploader.go index c8ca924..fac96b4 100644 --- a/core/uploader.go +++ b/core/uploader.go @@ -64,16 +64,16 @@ func Upload(input io.Reader, outputURI string, waitBetweenWrites, writeTimeout t err = backoff.Retry(func() error { _, err := session.SaveData(context.Background(), "", bytes.NewReader(fileContents), fields, segmentWriteTimeout) if err != nil { - glog.Errorf("failed upload attempt: %v", err) + glog.Errorf("failed upload attempt for %s: %v", outputURI, err) } return err }, UploadRetryBackoff()) if err != nil { - return fmt.Errorf("failed to upload video: %w", err) + return fmt.Errorf("failed to upload video %s: %w", outputURI, err) } if err = extractThumb(session, outputURI, fileContents); err != nil { - glog.Errorf("extracting thumbnail failed: %v", err) + glog.Errorf("extracting thumbnail failed for %s: %v", outputURI, err) } return nil }