Skip to content

Commit

Permalink
Add the create error to the chmod error
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Jul 18, 2024
1 parent 7a4640e commit 753c0f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io/fileutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ func createFileForWriting(destPath string) (*os.File, error) {
}

log.Debug(fmt.Sprintf("Couldn't to open the destination file: '%s' due to %s. Attempting to set the file permissions to read-write.", destPath, err.Error()))
if err = os.Chmod(destPath, 0600); err != nil {
return nil, err
if chmodErr := os.Chmod(destPath, 0600); chmodErr != nil {
return nil, errors.Join(err, chmodErr)
}

// Try to open the destination file again
Expand Down

0 comments on commit 753c0f7

Please sign in to comment.