Skip to content

Commit

Permalink
Merge pull request #33108 from unRob/patch-1
Browse files Browse the repository at this point in the history
Return debuggable CAS errors on consul state put
  • Loading branch information
alisdair committed Jun 30, 2023
2 parents 76290e8 + 8e5a66b commit ad2298b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/backend/remote-state/consul/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ func (c *RemoteClient) Put(data []byte) error {
}
// transaction was rolled back
if !ok {
return fmt.Errorf("consul CAS failed with transaction errors: %v", resp.Errors)
var resultErr error
for _, respError := range resp.Errors {
resultErr = multierror.Append(resultErr, errors.New(respError.What))
}
return fmt.Errorf("consul CAS failed with transaction errors: %w", resultErr)
}

if len(resp.Results) != 1 {
Expand Down

0 comments on commit ad2298b

Please sign in to comment.