Skip to content

Commit

Permalink
core: output "diffs didn't match" error details
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phinze committed Feb 23, 2016
1 parent adc0a8b commit fb5f715
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion terraform/eval_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Version, n.Info.Id, reason, one, two)
}

return nil, nil
Expand Down

0 comments on commit fb5f715

Please sign in to comment.