From 1ed22ba9a6c1ef725659d52dcb2aac5ea0715d65 Mon Sep 17 00:00:00 2001 From: Felipe Cotti Date: Mon, 27 Jan 2025 02:48:38 -0300 Subject: [PATCH] Don't hide errors from the uploader. --- src/Guestbooky-backup/internal/uploader/uploader.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Guestbooky-backup/internal/uploader/uploader.go b/src/Guestbooky-backup/internal/uploader/uploader.go index 99b368a..3c74071 100644 --- a/src/Guestbooky-backup/internal/uploader/uploader.go +++ b/src/Guestbooky-backup/internal/uploader/uploader.go @@ -24,12 +24,12 @@ func Upload(compactedFile string) error { s3Client, err := createS3Client() if err != nil { - return errors.New("failed to create S3 client") + return errors.New("failed to create S3 client: " + err.Error()) } file, err := os.Open(compactedFile) if err != nil { - return errors.New("failed to open file") + return errors.New("failed to open file: " + err.Error()) } defer file.Close() @@ -41,7 +41,7 @@ func Upload(compactedFile string) error { Body: file, }) if err != nil { - return errors.New("failed to upload file") + return errors.New("failed to upload file: " + err.Error()) } return nil @@ -62,7 +62,7 @@ func createS3Client() (*S3Client, error) { awsSession, err := session.NewSession(s3Config) if err != nil { - return nil, errors.New("failed to create S3 session") + return nil, errors.New("failed to create S3 session: " + err.Error()) } s3Client := s3.New(awsSession)