MaterializeInc / terraform-provider-materialize

A Terraform provider for Materialize
https://registry.terraform.io/providers/MaterializeInc/materialize
Mozilla Public License 2.0
11 stars 8 forks source link

Inconsistent Error Handling and Formatting for 404 Errors in `ReadUser` #641

Closed bobbyiliev closed 2 months ago

bobbyiliev commented 2 months ago

Currently, the ReadUser function handles 404 errors inconsistently:

  1. The doRequest method returns nil, fmt.Errorf(...) for 404 errors:
  2. Since err != nil, we immediately return the error from ReadUser.
  3. Later in ReadUser, an API error handler formats errors differently for non-200 status codes, causing inconsistency: https://github.com/MaterializeInc/terraform-provider-materialize/blob/08b526afd8a7c0c44e07953ecd6d6d071220ec34/pkg/frontegg/user.go#L95-L97

Suggested Changes: