Skip to content

Commit

Permalink
checkMachineFilePaths: forward error on failure
Browse files Browse the repository at this point in the history
Otherwise we just know something's wrong with the ISO but don't know exactly
what.

Signed-off-by: Serge Hallyn <[email protected]>
  • Loading branch information
hallyn committed Dec 11, 2023
1 parent d6156ca commit 00535df
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 00535df

Please sign in to comment.