From 90bfff30269f84bfce5db1236fba158a105d0cba Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 3 Nov 2016 12:09:51 -0700 Subject: [PATCH] terraform: shadow graph uses GraphWalkerPanicwrap to catch errors --- terraform/context.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/terraform/context.go b/terraform/context.go index 80bdf2d50..c8aac252d 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -736,11 +736,14 @@ func (c *Context) walk( // If we have a shadow graph, wait for that to complete. if shadowCloser != nil { - // Build the graph walker for the shadow. - shadowWalker := &ContextGraphWalker{ + // Build the graph walker for the shadow. We also wrap this in + // a panicwrap so that panics are captured. For the shadow graph, + // we just want panics to be normal errors rather than to crash + // Terraform. + shadowWalker := GraphWalkerPanicwrap(&ContextGraphWalker{ Context: shadowCtx, Operation: operation, - } + }) // Kick off the shadow walk. This will block on any operations // on the real walk so it is fine to start first.