Skip to content

Commit

Permalink
Batch errors now indicate how to disable batching
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
chrisst committed Jan 9, 2020
1 parent 5957448 commit 4d6a8d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion google/batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ func (b *RequestBatcher) SendRequestWithTimeout(batchKey string, request *BatchR
case resp := <-respCh:
if resp.err != nil {
// use wrapf so we can potentially extract the original error type
return nil, errwrap.Wrapf(fmt.Sprintf("Batch %q for request %q returned error: {{err}}", batchKey, request.DebugId), resp.err)
errMsg := fmt.Sprintf(
"Batch %q for request %q returned error: {{err}}. To debug individual requests, try disabling batching: https://www.terraform.io/docs/providers/google/guides/provider_reference.html#enable_batching",
batchKey, request.DebugId)
return nil, errwrap.Wrapf(errMsg, resp.err)
}
return resp.body, nil
case <-ctx.Done():
Expand Down

0 comments on commit 4d6a8d5

Please sign in to comment.