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

fix(product_enablement): error message check was too specific #687

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

Integralist
Copy link
Collaborator

@Integralist Integralist commented Apr 29, 2023

✅ Full end-to-end integration test suite is passing.

Some customers might be seeing a variation of the error "is not entitled to disable product"...

error: 400 - Bad Request:
    Title:  not entitled to disable

This means if the Terraform provider needed to call its DELETE flow for product_enablement, then it would end up returning the error (which would then stop a user's apply from completing successfully) rather than failing silently (as it's supposed to do for users who aren't entitled to a product).

@@ -535,7 +535,7 @@ func (h *ProductEnablementServiceAttributeHandler) checkAPIError(err error) erro
if he, ok := err.(*gofastly.HTTPError); ok {
if he.StatusCode == http.StatusBadRequest {
for _, e := range he.Errors {
if strings.Contains(e.Title, "is not entitled to disable product") {
if strings.Contains(e.Title, "not entitled to disable") || strings.Contains(e.Title, "product cannot be disabled") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two different users:

  1. Doesn't have access to the product
  2. Has access but not the permission to disable it.

@Integralist Integralist merged commit c5f2b45 into main Apr 29, 2023
@Integralist Integralist deleted the integralist/pe-bug branch April 29, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant