From 00535df578e98789aa7e2b90195746362d0cf95c Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Mon, 11 Dec 2023 12:10:59 -0600 Subject: [PATCH] checkMachineFilePaths: forward error on failure Otherwise we just know something's wrong with the ISO but don't know exactly what. Signed-off-by: Serge Hallyn --- cmd/machine/cmd/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/machine/cmd/init.go b/cmd/machine/cmd/init.go index 93796c6..cdc06bb 100644 --- a/cmd/machine/cmd/init.go +++ b/cmd/machine/cmd/init.go @@ -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) @@ -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