core: output "diffs didn't match" error details

Previously these details were relegated to the debug logs, which forces
the user to reproduce the error condition and then go digging for the
error message. Since we're asking users to report this error, let's give
them all the details they need right up front to make it a little easier
on them.
This commit is contained in:
Paul Hinze 2016-02-23 13:19:51 -06:00
parent adc0a8b126
commit 78f5780248
1 changed files with 12 additions and 1 deletions

View File

@ -45,7 +45,18 @@ func (n *EvalCompareDiff) Eval(ctx EvalContext) (interface{}, error) {
log.Printf("[ERROR] %s: diff two: %#v", n.Info.Id, two)
return nil, fmt.Errorf(
"%s: diffs didn't match during apply. This is a bug with "+
"Terraform and should be reported.", n.Info.Id)
"Terraform and should be reported as a GitHub Issue.\n"+
"\n"+
"Please include the following information in your report:\n"+
" Terraform Version: %s\n"+
" Resource ID: %s\n"+
" Mismatch reason: %s\n"+
" Diff One (usually from plan): %#v\n"+
" Diff Two (usually from apply): %#v\n"+
"\n"+
"Also include as much context as you can about your config, state,\n"+
" and the steps you performed to trigger this error.\n",
n.Info.Id, Version, n.Info.Id, reason, one, two)
}
return nil, nil