diff --git a/internal/provider/destination_data_source.go b/internal/provider/destination_data_source.go index d1c684d..3f924ef 100644 --- a/internal/provider/destination_data_source.go +++ b/internal/provider/destination_data_source.go @@ -81,7 +81,7 @@ func (d *destinationDataSource) Read(ctx context.Context, req datasource.ReadReq } if err != nil { resp.Diagnostics.AddError( - "Unable to read Destination", + fmt.Sprintf("Unable to read Destination (ID: %s)", state.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/destination_filter_resource.go b/internal/provider/destination_filter_resource.go index e2f3864..09b9680 100644 --- a/internal/provider/destination_filter_resource.go +++ b/internal/provider/destination_filter_resource.go @@ -202,7 +202,7 @@ func (r *destinationFilterResource) Read(ctx context.Context, req resource.ReadR } if err != nil { resp.Diagnostics.AddError( - "Unable to read Destination Filter", + fmt.Sprintf("Unable to read Destination Filter (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -271,7 +271,7 @@ func (r *destinationFilterResource) Update(ctx context.Context, req resource.Upd } if err != nil { resp.Diagnostics.AddError( - "Unable to update Destination Filter", + fmt.Sprintf("Unable to update Destination Filter (ID: %s)", state.ID.ValueString()), getError(err, body), ) @@ -314,7 +314,7 @@ func (r *destinationFilterResource) Delete(ctx context.Context, req resource.Del } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Destination Filter", + fmt.Sprintf("Unable to delete Destination Filter (ID: %s)", state.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/destination_metadata_data_source.go b/internal/provider/destination_metadata_data_source.go index 137373d..ac360a4 100644 --- a/internal/provider/destination_metadata_data_source.go +++ b/internal/provider/destination_metadata_data_source.go @@ -401,7 +401,7 @@ func (d *destinationMetadataDataSource) Read(ctx context.Context, req datasource } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source metadata", + fmt.Sprintf("Unable to read Source metadata (ID: %s)", state.ID.ValueString()), getError(err, body), ) @@ -412,7 +412,7 @@ func (d *destinationMetadataDataSource) Read(ctx context.Context, req datasource err = state.Fill(destinationMetadata) if err != nil { resp.Diagnostics.AddError( - "Unable to read Source metadata", + fmt.Sprintf("Unable to read Source metadata (ID: %s)", state.ID.ValueString()), err.Error(), ) diff --git a/internal/provider/destination_resource.go b/internal/provider/destination_resource.go index 95d9ca0..137716e 100644 --- a/internal/provider/destination_resource.go +++ b/internal/provider/destination_resource.go @@ -588,7 +588,7 @@ func (r *destinationResource) Read(ctx context.Context, req resource.ReadRequest } if err != nil { resp.Diagnostics.AddError( - "Unable to read Destination", + fmt.Sprintf("Unable to read Destination (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -650,7 +650,7 @@ func (r *destinationResource) Update(ctx context.Context, req resource.UpdateReq } if err != nil { resp.Diagnostics.AddError( - "Unable to update Destination", + fmt.Sprintf("Unable to update Destination (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -695,7 +695,7 @@ func (r *destinationResource) Delete(ctx context.Context, req resource.DeleteReq } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Destination", + fmt.Sprintf("Unable to delete Destination (ID: %s)", state.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/destination_subscription_resource.go b/internal/provider/destination_subscription_resource.go index 4963cb6..d7aaa52 100644 --- a/internal/provider/destination_subscription_resource.go +++ b/internal/provider/destination_subscription_resource.go @@ -182,7 +182,7 @@ func (r *destinationSubscriptionResource) Create(ctx context.Context, req resour } if err != nil { resp.Diagnostics.AddError( - "Unable to update Destination subscription", + fmt.Sprintf("Unable to update Destination subscription (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -229,7 +229,7 @@ func (r *destinationSubscriptionResource) Read(ctx context.Context, req resource } if err != nil { resp.Diagnostics.AddError( - "Unable to read Destination subscription", + fmt.Sprintf("Unable to read Destination subscription (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -312,7 +312,7 @@ func (r *destinationSubscriptionResource) Update(ctx context.Context, req resour } if err != nil { resp.Diagnostics.AddError( - "Unable to update Destination subscription", + fmt.Sprintf("Unable to update Destination subscription (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -353,7 +353,7 @@ func (r *destinationSubscriptionResource) Delete(ctx context.Context, req resour } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Destination subscription", + fmt.Sprintf("Unable to delete Destination subscription (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/function_resource.go b/internal/provider/function_resource.go index c312660..c5f8fa8 100644 --- a/internal/provider/function_resource.go +++ b/internal/provider/function_resource.go @@ -190,7 +190,7 @@ func (r *functionResource) Read(ctx context.Context, req resource.ReadRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to read Function", + fmt.Sprintf("Unable to read Function (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -247,7 +247,7 @@ func (r *functionResource) Update(ctx context.Context, req resource.UpdateReques } if err != nil { resp.Diagnostics.AddError( - "Unable to update Function", + fmt.Sprintf("Unable to update Function (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -284,7 +284,7 @@ func (r *functionResource) Delete(ctx context.Context, req resource.DeleteReques } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Function", + fmt.Sprintf("Unable to delete Function (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/insert_function_instance_resource.go b/internal/provider/insert_function_instance_resource.go index d56384d..d39aa2f 100644 --- a/internal/provider/insert_function_instance_resource.go +++ b/internal/provider/insert_function_instance_resource.go @@ -160,7 +160,7 @@ func (r *insertFunctionInstanceResource) Read(ctx context.Context, req resource. } if err != nil { resp.Diagnostics.AddError( - "Unable to read Insert Function instance", + fmt.Sprintf("Unable to read Insert Function instance (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -227,7 +227,7 @@ func (r *insertFunctionInstanceResource) Update(ctx context.Context, req resourc } if err != nil { resp.Diagnostics.AddError( - "Unable to update Insert Function instance", + fmt.Sprintf("Unable to update Insert Function instance (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -271,7 +271,7 @@ func (r *insertFunctionInstanceResource) Delete(ctx context.Context, req resourc } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Insert Function instance", + fmt.Sprintf("Unable to delete Insert Function instance (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/profiles_warehouse_resource.go b/internal/provider/profiles_warehouse_resource.go index 2af599c..ae3fc88 100644 --- a/internal/provider/profiles_warehouse_resource.go +++ b/internal/provider/profiles_warehouse_resource.go @@ -168,7 +168,7 @@ func (r *profilesWarehouseResource) Read(ctx context.Context, req resource.ReadR warehouse, err := findProfileWarehouse(r.authContext, r.client, previousState.ID.ValueString(), previousState.SpaceID.ValueString()) if err != nil { resp.Diagnostics.AddError( - "Unable to read Profiles Warehouse", + fmt.Sprintf("Unable to read Profiles Warehouse (ID: %s)", previousState.ID.ValueString()), err.Error(), ) @@ -240,7 +240,7 @@ func (r *profilesWarehouseResource) Update(ctx context.Context, req resource.Upd } if err != nil { resp.Diagnostics.AddError( - "Unable to update Profiles Warehouse", + fmt.Sprintf("Unable to update Profiles Warehouse (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -283,7 +283,7 @@ func (r *profilesWarehouseResource) Delete(ctx context.Context, req resource.Del } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Profiles Warehouse", + fmt.Sprintf("Unable to delete Profiles Warehouse (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/reverse_etl_model_resource.go b/internal/provider/reverse_etl_model_resource.go index 087ec87..eccfea9 100644 --- a/internal/provider/reverse_etl_model_resource.go +++ b/internal/provider/reverse_etl_model_resource.go @@ -161,7 +161,7 @@ func (r *reverseETLModelResource) Read(ctx context.Context, req resource.ReadReq } if err != nil { resp.Diagnostics.AddError( - "Unable to read Reverse ETL model", + fmt.Sprintf("Unable to read Reverse ETL model (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -222,7 +222,7 @@ func (r *reverseETLModelResource) Update(ctx context.Context, req resource.Updat } if err != nil { resp.Diagnostics.AddError( - "Unable to update Reverse ETL model", + fmt.Sprintf("Unable to update Reverse ETL model (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -264,7 +264,7 @@ func (r *reverseETLModelResource) Delete(ctx context.Context, req resource.Delet } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Reverse ETL model", + fmt.Sprintf("Unable to delete Reverse ETL model (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/role_data_source.go b/internal/provider/role_data_source.go index 8b65e76..5487a67 100644 --- a/internal/provider/role_data_source.go +++ b/internal/provider/role_data_source.go @@ -90,7 +90,7 @@ func (d *roleDataSource) Read(ctx context.Context, req datasource.ReadRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to read Role", + fmt.Sprintf("Unable to read Role (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -100,7 +100,7 @@ func (d *roleDataSource) Read(ctx context.Context, req datasource.ReadRequest, r role, err := findRole(out.Data.Roles, id) if err != nil { resp.Diagnostics.AddError( - "Unable to read Role", + fmt.Sprintf("Unable to read Role (ID: %s)", config.ID.ValueString()), err.Error(), ) diff --git a/internal/provider/source_data_source.go b/internal/provider/source_data_source.go index c65eb9b..51abebe 100644 --- a/internal/provider/source_data_source.go +++ b/internal/provider/source_data_source.go @@ -284,7 +284,7 @@ func (d *sourceDataSource) Read(ctx context.Context, req datasource.ReadRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to Read Source", + fmt.Sprintf("Unable to Read Source (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -302,7 +302,7 @@ func (d *sourceDataSource) Read(ctx context.Context, req datasource.ReadRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source schema settings", + fmt.Sprintf("Unable to read Source schema settings (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/source_metadata_data_source.go b/internal/provider/source_metadata_data_source.go index 65d0dd6..26d690a 100644 --- a/internal/provider/source_metadata_data_source.go +++ b/internal/provider/source_metadata_data_source.go @@ -60,7 +60,7 @@ func (d *sourceMetadataDataSource) Read(ctx context.Context, req datasource.Read } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source metadata", + fmt.Sprintf("Unable to read Source metadata (ID: %s)", state.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/source_resource.go b/internal/provider/source_resource.go index f27ef9c..138c713 100644 --- a/internal/provider/source_resource.go +++ b/internal/provider/source_resource.go @@ -310,7 +310,7 @@ func (r *sourceResource) Create(ctx context.Context, req resource.CreateRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to update Source after creation", + fmt.Sprintf("Unable to update Source after creation (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -388,7 +388,7 @@ func (r *sourceResource) Read(ctx context.Context, req resource.ReadRequest, res } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source", + fmt.Sprintf("Unable to read Source (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -454,7 +454,7 @@ func (r *sourceResource) Update(ctx context.Context, req resource.UpdateRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source before update", + fmt.Sprintf("Unable to read Source before update (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -479,7 +479,7 @@ func (r *sourceResource) Update(ctx context.Context, req resource.UpdateRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to update Source", + fmt.Sprintf("Unable to update Source (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -546,7 +546,7 @@ func (r *sourceResource) Delete(ctx context.Context, req resource.DeleteRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Source", + fmt.Sprintf("Unable to delete Source (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/source_tracking_plan_connection_resource.go b/internal/provider/source_tracking_plan_connection_resource.go index 553f877..eb869f8 100644 --- a/internal/provider/source_tracking_plan_connection_resource.go +++ b/internal/provider/source_tracking_plan_connection_resource.go @@ -211,7 +211,7 @@ func (r *sourceTrackingPlanConnectionResource) Create(ctx context.Context, req r } if err != nil { resp.Diagnostics.AddError( - "Unable to update Source schema settings", + fmt.Sprintf("Unable to update Source schema settings (ID: %s)", plan.SourceID.ValueString()), getError(err, body), ) @@ -256,7 +256,7 @@ func (r *sourceTrackingPlanConnectionResource) Read(ctx context.Context, req res } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source", + fmt.Sprintf("Unable to read Source (ID: %s)", previousState.SourceID.ValueString()), getError(err, body), ) @@ -284,7 +284,7 @@ func (r *sourceTrackingPlanConnectionResource) Read(ctx context.Context, req res } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source schema settings", + fmt.Sprintf("Unable to read Source schema settings (ID: %s)", previousState.SourceID.ValueString()), getError(err, body), ) @@ -321,7 +321,7 @@ func (r *sourceTrackingPlanConnectionResource) Update(ctx context.Context, req r } if err != nil { resp.Diagnostics.AddError( - "Unable to read Source", + fmt.Sprintf("Unable to read Source (ID: %s)", plan.SourceID.ValueString()), getError(err, body), ) @@ -357,7 +357,7 @@ func (r *sourceTrackingPlanConnectionResource) Update(ctx context.Context, req r } if err != nil { resp.Diagnostics.AddError( - "Unable to update Source schema settings", + fmt.Sprintf("Unable to update Source schema settings (ID: %s)", plan.SourceID.ValueString()), getError(err, body), ) diff --git a/internal/provider/tracking_plan_data_source.go b/internal/provider/tracking_plan_data_source.go index 43b47a7..42520d4 100644 --- a/internal/provider/tracking_plan_data_source.go +++ b/internal/provider/tracking_plan_data_source.go @@ -143,7 +143,7 @@ func (d *trackingPlanDataSource) Read(ctx context.Context, req datasource.ReadRe } if err != nil { resp.Diagnostics.AddError( - "Unable to read Tracking Plan", + fmt.Sprintf("Unable to read Tracking Plan (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -158,7 +158,7 @@ func (d *trackingPlanDataSource) Read(ctx context.Context, req datasource.ReadRe } if err != nil { resp.Diagnostics.AddError( - "Unable to read Tracking Plan rules", + fmt.Sprintf("Unable to read Tracking Plan rules (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/tracking_plan_resource.go b/internal/provider/tracking_plan_resource.go index 9c7c43d..e6c6184 100644 --- a/internal/provider/tracking_plan_resource.go +++ b/internal/provider/tracking_plan_resource.go @@ -228,7 +228,7 @@ func (r *trackingPlanResource) Read(ctx context.Context, req resource.ReadReques } if err != nil { resp.Diagnostics.AddError( - "Unable to read Tracking Plan", + fmt.Sprintf("Unable to read Tracking Plan (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -245,7 +245,7 @@ func (r *trackingPlanResource) Read(ctx context.Context, req resource.ReadReques err = state.Fill(trackingPlan, nil) if err != nil { resp.Diagnostics.AddError( - "Unable to read Tracking Plan", + "Unable to populate Tracking Plan state", err.Error(), ) @@ -259,7 +259,7 @@ func (r *trackingPlanResource) Read(ctx context.Context, req resource.ReadReques } if err != nil { resp.Diagnostics.AddError( - "Unable to read Tracking Plan rules", + fmt.Sprintf("Unable to read Tracking Plan rules (ID: %s)", id), getError(err, body), ) @@ -319,7 +319,7 @@ func (r *trackingPlanResource) Update(ctx context.Context, req resource.UpdateRe } if err != nil { resp.Diagnostics.AddError( - "Unable to update Tracking Plan", + fmt.Sprintf("Unable to update Tracking Plan (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -332,7 +332,7 @@ func (r *trackingPlanResource) Update(ctx context.Context, req resource.UpdateRe } if err != nil { resp.Diagnostics.AddError( - "Unable to read Tracking Plan", + fmt.Sprintf("Unable to read Tracking Plan (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -411,7 +411,7 @@ func (r *trackingPlanResource) Delete(ctx context.Context, req resource.DeleteRe } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Tracking Plan", + fmt.Sprintf("Unable to delete Tracking Plan (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/transformation_resource.go b/internal/provider/transformation_resource.go index 735b73c..9740171 100644 --- a/internal/provider/transformation_resource.go +++ b/internal/provider/transformation_resource.go @@ -207,7 +207,7 @@ func (r *transformationResource) Read(ctx context.Context, req resource.ReadRequ } if err != nil { resp.Diagnostics.AddError( - "Unable to read Transformation", + fmt.Sprintf("Unable to read Transformation (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -274,7 +274,7 @@ func (r *transformationResource) Update(ctx context.Context, req resource.Update } if err != nil { resp.Diagnostics.AddError( - "Unable to update Transformation", + fmt.Sprintf("Unable to update Transformation (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -304,7 +304,7 @@ func (r *transformationResource) Delete(ctx context.Context, req resource.Delete } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Transformation", + fmt.Sprintf("Unable to delete Transformation (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/user_data_source.go b/internal/provider/user_data_source.go index 35154fc..014e6df 100644 --- a/internal/provider/user_data_source.go +++ b/internal/provider/user_data_source.go @@ -133,7 +133,7 @@ func (d *userDataSource) Read(ctx context.Context, req datasource.ReadRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to read user", + fmt.Sprintf("Unable to read user (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -144,7 +144,7 @@ func (d *userDataSource) Read(ctx context.Context, req datasource.ReadRequest, r err = state.Fill(out.Data.User) if err != nil { resp.Diagnostics.AddError( - "Unable to read user", + "Unable to populate user state", err.Error(), ) diff --git a/internal/provider/user_group_resource.go b/internal/provider/user_group_resource.go index af54b5a..fe01ca0 100644 --- a/internal/provider/user_group_resource.go +++ b/internal/provider/user_group_resource.go @@ -199,7 +199,7 @@ func (r *userGroupResource) Create(ctx context.Context, req resource.CreateReque } if err != nil { resp.Diagnostics.AddError( - "Unable to read User Group", + fmt.Sprintf("Unable to read User Group (ID: %s)", userGroup.Id), getError(err, body), ) @@ -239,7 +239,7 @@ func (r *userGroupResource) Read(ctx context.Context, req resource.ReadRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to read User Group", + fmt.Sprintf("Unable to read User Group (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -253,7 +253,7 @@ func (r *userGroupResource) Read(ctx context.Context, req resource.ReadRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to read User Group members", + fmt.Sprintf("Unable to read User Group members (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -266,7 +266,7 @@ func (r *userGroupResource) Read(ctx context.Context, req resource.ReadRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to read User Group members", + fmt.Sprintf("Unable to read User Group members (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -320,7 +320,7 @@ func (r *userGroupResource) Update(ctx context.Context, req resource.UpdateReque } if err != nil { resp.Diagnostics.AddError( - "Unable to update User Group", + fmt.Sprintf("Unable to update User Group (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -373,7 +373,7 @@ func (r *userGroupResource) Update(ctx context.Context, req resource.UpdateReque } if err != nil { resp.Diagnostics.AddError( - "Unable to read User Group", + fmt.Sprintf("Unable to read User Group (ID: %s)", config.ID.ValueString()), getError(err, body), ) @@ -412,7 +412,7 @@ func (r *userGroupResource) Delete(ctx context.Context, req resource.DeleteReque } if err != nil { resp.Diagnostics.AddError( - "Unable to delete User Group", + fmt.Sprintf("Unable to delete User Group (ID: %s)", config.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/user_resource.go b/internal/provider/user_resource.go index 987ddb4..f1737df 100644 --- a/internal/provider/user_resource.go +++ b/internal/provider/user_resource.go @@ -260,7 +260,7 @@ func (r *userResource) Read(ctx context.Context, req resource.ReadRequest, resp } if err != nil { resp.Diagnostics.AddError( - "Unable to read user", + fmt.Sprintf("Unable to read user (ID: %s)", state.ID.ValueString()), getError(err, body), ) @@ -329,7 +329,7 @@ func (r *userResource) Update(ctx context.Context, req resource.UpdateRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to delete user", + fmt.Sprintf("Unable to delete user (ID: %s)", state.ID.ValueString()), getError(err, body), ) @@ -393,7 +393,7 @@ func (r *userResource) Update(ctx context.Context, req resource.UpdateRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to update user", + fmt.Sprintf("Unable to update user (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -406,7 +406,7 @@ func (r *userResource) Update(ctx context.Context, req resource.UpdateRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to read user", + fmt.Sprintf("Unable to read user (ID: %s)", userID), getError(err, body), ) @@ -459,7 +459,7 @@ func (r *userResource) Delete(ctx context.Context, req resource.DeleteRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to delete user", + fmt.Sprintf("Unable to delete user (ID: %s)", state.ID.ValueString()), getError(err, body), ) @@ -478,7 +478,7 @@ func (r *userResource) Delete(ctx context.Context, req resource.DeleteRequest, r } if err != nil { resp.Diagnostics.AddError( - "Unable to delete user", + fmt.Sprintf("Unable to delete user (ID: %s)", state.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/warehouse_data_source.go b/internal/provider/warehouse_data_source.go index 2c3d912..aa72ebd 100644 --- a/internal/provider/warehouse_data_source.go +++ b/internal/provider/warehouse_data_source.go @@ -88,7 +88,7 @@ func (d *warehouseDataSource) Read(ctx context.Context, req datasource.ReadReque } if err != nil { resp.Diagnostics.AddError( - "Unable to Read Warehouse", + fmt.Sprintf("Unable to Read Warehouse (ID: %s)", state.ID.ValueString()), getError(err, body), ) diff --git a/internal/provider/warehouse_metadata_data_source.go b/internal/provider/warehouse_metadata_data_source.go index 9d3b407..0a5de8f 100644 --- a/internal/provider/warehouse_metadata_data_source.go +++ b/internal/provider/warehouse_metadata_data_source.go @@ -131,7 +131,7 @@ func (d *warehouseMetadataDataSource) Read(ctx context.Context, req datasource.R } if err != nil { resp.Diagnostics.AddError( - "Unable to Read Warehouse metadata", + fmt.Sprintf("Unable to Read Warehouse metadata (ID: %s)", state.ID.ValueString()), getError(err, body), ) @@ -143,7 +143,7 @@ func (d *warehouseMetadataDataSource) Read(ctx context.Context, req datasource.R err = state.Fill(warehouseMetadata) if err != nil { resp.Diagnostics.AddError( - "Unable to Read Warehouse metadata", + "Unable to populate Warehouse metadata state", err.Error(), ) diff --git a/internal/provider/warehouse_resource.go b/internal/provider/warehouse_resource.go index 17413b5..1bd6a25 100644 --- a/internal/provider/warehouse_resource.go +++ b/internal/provider/warehouse_resource.go @@ -289,7 +289,7 @@ func (r *warehouseResource) Read(ctx context.Context, req resource.ReadRequest, } if err != nil { resp.Diagnostics.AddError( - "Unable to read Warehouse", + fmt.Sprintf("Unable to read Warehouse (ID: %s)", previousState.ID.ValueString()), getError(err, body), ) @@ -350,7 +350,7 @@ func (r *warehouseResource) Update(ctx context.Context, req resource.UpdateReque } if err != nil { resp.Diagnostics.AddError( - "Unable to read Warehouse before update", + fmt.Sprintf("Unable to read Warehouse before update (ID: %s)", state.ID.ValueString()), getError(err, body), ) @@ -374,7 +374,7 @@ func (r *warehouseResource) Update(ctx context.Context, req resource.UpdateReque } if err != nil { resp.Diagnostics.AddError( - "Unable to update Warehouse", + fmt.Sprintf("Unable to update Warehouse (ID: %s)", plan.ID.ValueString()), getError(err, body), ) @@ -417,7 +417,7 @@ func (r *warehouseResource) Delete(ctx context.Context, req resource.DeleteReque } if err != nil { resp.Diagnostics.AddError( - "Unable to delete Warehouse", + fmt.Sprintf("Unable to delete Warehouse (ID: %s)", config.ID.ValueString()), getError(err, body), )