Skip to content

Commit

Permalink
Merge pull request #30 from hallyn/2023-12-11/fwderr
Browse files Browse the repository at this point in the history
checkMachineFilePaths: forward error on failure
  • Loading branch information
raharper authored Dec 12, 2023
2 parents d6156ca + 00535df commit 88869c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/machine/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func checkMachineFilePaths(newMachine *api.Machine) error {
if disk.File != "" && disk.Size == 0 {
newPath, err := verifyPath(cwd, disk.File)
if err != nil {
return fmt.Errorf("Failed to verify path to disk %q", disk.File)
return fmt.Errorf("Failed to verify path to disk %q: %w", disk.File, err)
}
if newPath != disk.File {
log.Infof("Fully qualified disk path %s", newPath)
Expand All @@ -253,7 +253,7 @@ func checkMachineFilePaths(newMachine *api.Machine) error {
if newMachine.Config.Cdrom != "" {
newPath, err := verifyPath(cwd, newMachine.Config.Cdrom)
if err != nil {
return fmt.Errorf("Failed to verify path to cdrom %q", newMachine.Config.Cdrom)
return fmt.Errorf("Failed to verify path to cdrom %q: %w", newMachine.Config.Cdrom, err)
}
log.Infof("Fully qualified cdrom path %s", newPath)
newMachine.Config.Cdrom = newPath
Expand Down

0 comments on commit 88869c1

Please sign in to comment.