Don't hide errors from the uploader.
Some checks failed
CI/CD / build-backup-job (push) Has been cancelled
CI/CD / build-and-test-backend (push) Has been cancelled

This commit is contained in:
Felipe Cotti 2025-01-27 02:48:38 -03:00
parent 112b994638
commit 1ed22ba9a6

View file

@ -24,12 +24,12 @@ func Upload(compactedFile string) error {
s3Client, err := createS3Client() s3Client, err := createS3Client()
if err != nil { 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) file, err := os.Open(compactedFile)
if err != nil { if err != nil {
return errors.New("failed to open file") return errors.New("failed to open file: " + err.Error())
} }
defer file.Close() defer file.Close()
@ -41,7 +41,7 @@ func Upload(compactedFile string) error {
Body: file, Body: file,
}) })
if err != nil { if err != nil {
return errors.New("failed to upload file") return errors.New("failed to upload file: " + err.Error())
} }
return nil return nil
@ -62,7 +62,7 @@ func createS3Client() (*S3Client, error) {
awsSession, err := session.NewSession(s3Config) awsSession, err := session.NewSession(s3Config)
if err != nil { 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) s3Client := s3.New(awsSession)