Skip to content

Commit

Permalink
refactor: implement better error logging in writeTar and writeZip
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed Aug 22, 2021
1 parent 7b352ff commit 90a8af0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions archiver/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func writeTar(archiveFile *os.File, filesToBackup []BackupFileMetadata) {
pathInArchive := getPathInArchive(filePath, fileMetadata.BackupBasePath)

if err := addFileToTar(tw, filePath, pathInArchive); err != nil {
log.Println(err)
log.Printf("Error while adding %s to the archive. %s", filePath, err)
}

bar.Increment()
Expand All @@ -98,7 +98,7 @@ func writeZip(archiveFile *os.File, filesToBackup []BackupFileMetadata) {
pathInArchive := getPathInArchive(filePath, fileMetadata.BackupBasePath)

if err := addFileToZip(zw, filePath, pathInArchive); err != nil {
log.Println(err)
log.Printf("Error while adding %s to the archive. %s", filePath, err)
}

bar.Increment()
Expand Down

0 comments on commit 90a8af0

Please sign in to comment.