From 59472c6aadf41c1fe1e895c43c5f5a37b9ae761c Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Thu, 14 Nov 2019 13:40:40 -0800 Subject: [PATCH] builder/lxc: fix dropped error --- builder/lxc/step_export.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/lxc/step_export.go b/builder/lxc/step_export.go index 52fd6e546..890949bde 100644 --- a/builder/lxc/step_export.go +++ b/builder/lxc/step_export.go @@ -53,7 +53,12 @@ func (s *stepExport) Run(ctx context.Context, state multistep.StateBag) multiste } _, err = io.Copy(configFile, originalConfigFile) - + if err != nil { + err := fmt.Errorf("error copying file %s: %v", config.ConfigFile, err) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } commands := make([][]string, 3) commands[0] = []string{ "lxc-stop", "--name", name,