Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return debuggable CAS errors on consul state put #33108

Merged
merged 4 commits into from
Jun 30, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -231,8 +231,12 @@
}
// 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 = append(resultErr, errors.New(respError.What))
unRob marked this conversation as resolved.
Show resolved Hide resolved
}
return fmt.Errorf("consul CAS failed with transaction errors: %w", resultErr)
}

Check failure on line 239 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Race Tests

first argument to append must be a slice; have resultErr (variable of type error)

Check failure on line 239 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Unit Tests

first argument to append must be a slice; have resultErr (variable of type error)

Check failure on line 239 in internal/backend/remote-state/consul/client.go

View workflow job for this annotation

GitHub Actions / Code Consistency Checks

first argument to append must be a slice; have resultErr (variable of type error) (compile)

if len(resp.Results) != 1 {
// this probably shouldn't happen
Expand Down