From dd92d492ee32a2f978a5370677f6793689497018 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 25 Jun 2013 14:30:08 -0500 Subject: [PATCH] packer/plugin: No need for a panic when plugins error --- packer/plugin/plugin.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packer/plugin/plugin.go b/packer/plugin/plugin.go index 72629359c..137b691b2 100644 --- a/packer/plugin/plugin.go +++ b/packer/plugin/plugin.go @@ -115,7 +115,8 @@ func ServeBuilder(builder packer.Builder) { swallowInterrupts() if err := serve(server); err != nil { - log.Panic(err) + log.Printf("ERROR: %s", err) + os.Exit(1) } } @@ -128,7 +129,8 @@ func ServeCommand(command packer.Command) { swallowInterrupts() if err := serve(server); err != nil { - log.Panic(err) + log.Printf("ERROR: %s", err) + os.Exit(1) } } @@ -141,7 +143,8 @@ func ServeHook(hook packer.Hook) { swallowInterrupts() if err := serve(server); err != nil { - log.Panic(err) + log.Printf("ERROR: %s", err) + os.Exit(1) } } @@ -154,7 +157,8 @@ func ServePostProcessor(p packer.PostProcessor) { swallowInterrupts() if err := serve(server); err != nil { - log.Panic(err) + log.Printf("ERROR: %s", err) + os.Exit(1) } } @@ -167,6 +171,7 @@ func ServeProvisioner(p packer.Provisioner) { swallowInterrupts() if err := serve(server); err != nil { - log.Panic(err) + log.Printf("ERROR: %s", err) + os.Exit(1) } }