diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/terraform/eval_error.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/terraform/eval_error.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/terraform/eval_error.go b/vendor/github.com/hashicorp/terraform/terraform/eval_error.go new file mode 100644 index 00000000..470f798b --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/terraform/eval_error.go @@ -0,0 +1,20 @@ +package terraform + +// EvalReturnError is an EvalNode implementation that returns an +// error if it is present. +// +// This is useful for scenarios where an error has been captured by +// another EvalNode (like EvalApply) for special EvalTree-based error +// handling, and that handling has completed, so the error should be +// returned normally. +type EvalReturnError struct { + Error *error +} + +func (n *EvalReturnError) Eval(ctx EvalContext) (interface{}, error) { + if n.Error == nil { + return nil, nil + } + + return nil, *n.Error +} |