Skip to content

Commit d911c95

Browse files
mawasilegithub-actions[bot]
and
github-actions[bot]
authored
Update error messages to use FullTypeName for better clarity in diagn… (#673)
* Update error messages to use FullTypeName for better clarity in diagnostics * Standardize logging and error messages by replacing ProviderTypeName with FullTypeName * Normalize error messages in tests to lowercase for consistency --------- Co-authored-by: github-actions[bot] <[email protected]>
1 parent 1641af6 commit d911c95

File tree

38 files changed

+133
-128
lines changed

38 files changed

+133
-128
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: fixed
2+
body: standardize the logging and error messages by replacing `ProviderTypeName` with `FullTypeName`
3+
time: 2025-03-31T12:48:17.86943761Z
4+
custom:
5+
Issue: "673"

internal/services/application/datasource_environment_application_packages.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (d *EnvironmentApplicationPackagesDataSource) Read(ctx context.Context, req
171171
var state EnvironmentApplicationPackagesListDataSourceModel
172172
resp.State.Get(ctx, &state)
173173

174-
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE ENVIRONMENT APPLICATION PACKAGES START: %s", d.ProviderTypeName))
174+
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE ENVIRONMENT APPLICATION PACKAGES START: %s", d.FullTypeName()))
175175

176176
state.EnvironmentId = types.StringValue(state.EnvironmentId.ValueString())
177177
state.Name = types.StringValue(state.Name.ValueString())
@@ -189,7 +189,7 @@ func (d *EnvironmentApplicationPackagesDataSource) Read(ctx context.Context, req
189189

190190
applications, err := d.ApplicationClient.GetApplicationsByEnvironmentId(ctx, state.EnvironmentId.ValueString())
191191
if err != nil {
192-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.ProviderTypeName), err.Error())
192+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.FullTypeName()), err.Error())
193193
return
194194
}
195195

@@ -215,7 +215,7 @@ func (d *EnvironmentApplicationPackagesDataSource) Read(ctx context.Context, req
215215
state.Id = types.StringValue(fmt.Sprintf("%s_%d", state.EnvironmentId.ValueString(), len(applications)))
216216
diags := resp.State.Set(ctx, &state)
217217

218-
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE ENVIRONMENT APPLICATION PACKAGES END: %s", d.ProviderTypeName))
218+
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE ENVIRONMENT APPLICATION PACKAGES END: %s", d.FullTypeName()))
219219

220220
resp.Diagnostics.Append(diags...)
221221
if resp.Diagnostics.HasError() {

internal/services/application/datasource_tenant_application_packages.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (d *TenantApplicationPackagesDataSource) Read(ctx context.Context, req data
178178

179179
applications, err := d.ApplicationClient.GetTenantApplications(ctx)
180180
if err != nil {
181-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.ProviderTypeName), err.Error())
181+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.FullTypeName()), err.Error())
182182
return
183183
}
184184

internal/services/application/resource_environment_application_package_install.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (r *EnvironmentApplicationPackageInstallResource) Create(ctx context.Contex
121121

122122
applicationId, err := r.ApplicationClient.InstallApplicationInEnvironment(ctx, state.EnvironmentId.ValueString(), state.UniqueName.ValueString())
123123
if err != nil {
124-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.ProviderTypeName), err.Error())
124+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
125125
return
126126
}
127127

@@ -144,7 +144,7 @@ func (r *EnvironmentApplicationPackageInstallResource) Read(ctx context.Context,
144144
return
145145
}
146146

147-
tflog.Debug(ctx, fmt.Sprintf("READ: %s_application with application_name %s", r.ProviderTypeName, state.UniqueName.ValueString()))
147+
tflog.Debug(ctx, fmt.Sprintf("READ: %s with application_name %s", r.FullTypeName(), state.UniqueName.ValueString()))
148148

149149
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
150150
}

internal/services/authorization/datasource_securityroles.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (d *SecurityRolesDataSource) Read(ctx context.Context, req datasource.ReadR
137137

138138
roles, err := d.UserClient.GetDataverseSecurityRoles(ctx, state.EnvironmentId.ValueString(), state.BusinessUnitId.ValueString())
139139
if err != nil {
140-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s_%s", d.ProviderTypeName, d.TypeName), err.Error())
140+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.FullTypeName()), err.Error())
141141
return
142142
}
143143

internal/services/authorization/resource_user.go

+22-22
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func (r *UserResource) Create(ctx context.Context, req resource.CreateRequest, r
165165

166166
hasEnvDataverse, err := r.UserClient.EnvironmentHasDataverse(ctx, plan.EnvironmentId.ValueString())
167167
if err != nil {
168-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
168+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
169169
return
170170
}
171171
tflog.Debug(ctx, fmt.Sprintf("Dataverse exist in eviroment %t", hasEnvDataverse))
@@ -174,26 +174,26 @@ func (r *UserResource) Create(ctx context.Context, req resource.CreateRequest, r
174174
if hasEnvDataverse {
175175
user, err := r.UserClient.CreateDataverseUser(ctx, plan.EnvironmentId.ValueString(), plan.AadId.ValueString())
176176
if err != nil {
177-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
177+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
178178
return
179179
}
180180

181181
user, err = r.UserClient.AddDataverseSecurityRoles(ctx, plan.EnvironmentId.ValueString(), user.Id, plan.SecurityRoles)
182182
if err != nil {
183-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
183+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
184184
return
185185
}
186186
newUser = *user
187187
} else {
188188
// todo disalbe delete should be set to false.
189189
err := validateEnvironmentSecurityRoles(plan.SecurityRoles)
190190
if err != nil {
191-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
191+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
192192
}
193193

194194
user, err := r.UserClient.CreateEnvironmentUser(ctx, plan.EnvironmentId.ValueString(), plan.AadId.ValueString(), plan.SecurityRoles)
195195
if err != nil {
196-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
196+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
197197
return
198198
}
199199

@@ -236,7 +236,7 @@ func (r *UserResource) Read(ctx context.Context, req resource.ReadRequest, resp
236236

237237
hasEnvDataverse, err := r.UserClient.EnvironmentHasDataverse(ctx, state.EnvironmentId.ValueString())
238238
if err != nil {
239-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
239+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
240240
return
241241
}
242242
tflog.Debug(ctx, fmt.Sprintf("Dataverse exist in eviroment %t", hasEnvDataverse))
@@ -249,7 +249,7 @@ func (r *UserResource) Read(ctx context.Context, req resource.ReadRequest, resp
249249
resp.State.RemoveResource(ctx)
250250
return
251251
}
252-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
252+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", r.FullTypeName()), err.Error())
253253
return
254254
}
255255
updateUser = *user
@@ -266,7 +266,7 @@ func (r *UserResource) Read(ctx context.Context, req resource.ReadRequest, resp
266266
resp.State.RemoveResource(ctx)
267267
return
268268
}
269-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
269+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", r.FullTypeName()), err.Error())
270270
return
271271
}
272272

@@ -292,7 +292,7 @@ func (r *UserResource) Read(ctx context.Context, req resource.ReadRequest, resp
292292
state.DisableDelete = model.DisableDelete
293293
state.BusinessUnitId = model.BusinessUnitId
294294

295-
tflog.Debug(ctx, fmt.Sprintf("READ: %s_environment with id %s", r.ProviderTypeName, state.Id.ValueString()))
295+
tflog.Debug(ctx, fmt.Sprintf("READ: %s with id %s", r.FullTypeName(), state.Id.ValueString()))
296296

297297
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
298298
}
@@ -314,7 +314,7 @@ func (r *UserResource) Update(ctx context.Context, req resource.UpdateRequest, r
314314

315315
hasEnvDataverse, err := r.UserClient.EnvironmentHasDataverse(ctx, state.EnvironmentId.ValueString())
316316
if err != nil {
317-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
317+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
318318
return
319319
}
320320
tflog.Debug(ctx, fmt.Sprintf("Dataverse exist in eviroment %t", hasEnvDataverse))
@@ -325,28 +325,28 @@ func (r *UserResource) Update(ctx context.Context, req resource.UpdateRequest, r
325325
if len(addedSecurityRoles) > 0 {
326326
userDto, err := r.UserClient.AddDataverseSecurityRoles(ctx, plan.EnvironmentId.ValueString(), state.Id.ValueString(), addedSecurityRoles)
327327
if err != nil {
328-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when adding security roles %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
328+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when adding security roles %s", r.FullTypeName()), err.Error())
329329
return
330330
}
331331
user = *userDto
332332
}
333333
if len(removedSecurityRoles) > 0 {
334334
userDto, err := r.UserClient.RemoveDataverseSecurityRoles(ctx, plan.EnvironmentId.ValueString(), state.Id.ValueString(), removedSecurityRoles)
335335
if err != nil {
336-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when removing security roles %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
336+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when removing security roles %s", r.FullTypeName()), err.Error())
337337
return
338338
}
339339
user = *userDto
340340
}
341341
} else {
342342
err := validateEnvironmentSecurityRoles(plan.SecurityRoles)
343343
if err != nil {
344-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when updating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
344+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when updating %s", r.FullTypeName()), err.Error())
345345
}
346346
if len(addedSecurityRoles) > 0 {
347347
userDto, err := r.UserClient.AddEnvironmentUserSecurityRoles(ctx, plan.EnvironmentId.ValueString(), plan.AadId.ValueString(), addedSecurityRoles)
348348
if err != nil {
349-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when adding security roles %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
349+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when adding security roles %s", r.FullTypeName()), err.Error())
350350
return
351351
}
352352
user = *userDto
@@ -355,19 +355,19 @@ func (r *UserResource) Update(ctx context.Context, req resource.UpdateRequest, r
355355
savedRoles := []securityRoleDto{}
356356
rolesObj, diag := resp.Private.GetKey(ctx, "role")
357357
if diag.HasError() {
358-
resp.Diagnostics.AddError(fmt.Sprintf("Error when updating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
358+
resp.Diagnostics.AddError(fmt.Sprintf("Error when updating %s", r.FullTypeName()), err.Error())
359359
return
360360
}
361361

362362
err := json.Unmarshal(rolesObj, &savedRoles)
363363
if err != nil {
364-
resp.Diagnostics.AddError(fmt.Sprintf("Error when updating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
364+
resp.Diagnostics.AddError(fmt.Sprintf("Error when updating %s", r.FullTypeName()), err.Error())
365365
return
366366
}
367367

368368
userDto, err := r.UserClient.RemoveEnvironmentUserSecurityRoles(ctx, plan.EnvironmentId.ValueString(), plan.AadId.ValueString(), removedSecurityRoles, savedRoles)
369369
if err != nil {
370-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when removing security roles %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
370+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when removing security roles %s", r.FullTypeName()), err.Error())
371371
return
372372
}
373373
user = *userDto
@@ -409,7 +409,7 @@ func (r *UserResource) Delete(ctx context.Context, req resource.DeleteRequest, r
409409

410410
hasEnvDataverse, err := r.UserClient.EnvironmentHasDataverse(ctx, state.EnvironmentId.ValueString())
411411
if err != nil {
412-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
412+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating %s", r.FullTypeName()), err.Error())
413413
return
414414
}
415415
tflog.Debug(ctx, fmt.Sprintf("Dataverse exist in eviroment %t", hasEnvDataverse))
@@ -418,7 +418,7 @@ func (r *UserResource) Delete(ctx context.Context, req resource.DeleteRequest, r
418418
if state.DisableDelete.ValueBool() {
419419
err := r.UserClient.DeleteDataverseUser(ctx, state.EnvironmentId.ValueString(), state.Id.ValueString())
420420
if err != nil {
421-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
421+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s", r.FullTypeName()), err.Error())
422422
return
423423
}
424424
} else {
@@ -433,17 +433,17 @@ func (r *UserResource) Delete(ctx context.Context, req resource.DeleteRequest, r
433433

434434
err := json.Unmarshal(rolesObj, &savedRoles)
435435
if err != nil {
436-
resp.Diagnostics.AddError(fmt.Sprintf("Error when deleting %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
436+
resp.Diagnostics.AddError(fmt.Sprintf("Error when deleting %s", r.FullTypeName()), err.Error())
437437
return
438438
}
439439

440440
_, err = r.UserClient.RemoveEnvironmentUserSecurityRoles(ctx, state.EnvironmentId.ValueString(), state.AadId.ValueString(), state.SecurityRoles, savedRoles)
441441
if err != nil {
442-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
442+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s", r.FullTypeName()), err.Error())
443443
return
444444
}
445445
}
446-
tflog.Debug(ctx, fmt.Sprintf("DELETE RESOURCE END: %s", r.ProviderTypeName))
446+
tflog.Debug(ctx, fmt.Sprintf("DELETE RESOURCE END: %s", r.FullTypeName()))
447447
}
448448

449449
func (r *UserResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {

internal/services/connection/datasource_connections.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ func (d *ConnectionsDataSource) Read(ctx context.Context, req datasource.ReadReq
121121
var state ConnectionsListDataSourceModel
122122
resp.State.Get(ctx, &state)
123123

124-
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE START: %s", d.ProviderTypeName))
124+
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE START: %s", d.FullTypeName()))
125125

126126
connections, err := d.ConnectionsClient.GetConnections(ctx, state.EnvironmentId.ValueString())
127127
if err != nil {
128-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.ProviderTypeName), err.Error())
128+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.FullTypeName()), err.Error())
129129
return
130130
}
131131

@@ -135,7 +135,7 @@ func (d *ConnectionsDataSource) Read(ctx context.Context, req datasource.ReadReq
135135
}
136136
diags := resp.State.Set(ctx, &state)
137137

138-
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE END: %s", d.ProviderTypeName))
138+
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE END: %s", d.FullTypeName()))
139139

140140
resp.Diagnostics.Append(diags...)
141141
if resp.Diagnostics.HasError() {

internal/services/connection/resource_connection.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *res
222222
resp.State.RemoveResource(ctx)
223223
return
224224
}
225-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
225+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", r.FullTypeName()), err.Error())
226226
return
227227
}
228228

@@ -275,7 +275,7 @@ func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp
275275

276276
connection, err := r.ConnectionsClient.UpdateConnection(ctx, plan.EnvironmentId.ValueString(), plan.Name.ValueString(), plan.Id.ValueString(), plan.DisplayName.ValueString(), connParams, connParamsSet)
277277
if err != nil {
278-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when updating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
278+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when updating %s", r.FullTypeName()), err.Error())
279279
return
280280
}
281281

@@ -311,7 +311,7 @@ func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp
311311

312312
err := r.ConnectionsClient.DeleteConnection(ctx, state.EnvironmentId.ValueString(), state.Name.ValueString(), state.Id.ValueString())
313313
if err != nil {
314-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
314+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s", r.FullTypeName()), err.Error())
315315
return
316316
}
317317
}

internal/services/connectors/datasource_connectors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (d *DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp
122122

123123
connectors, err := d.ConnectorsClient.GetConnectors(ctx)
124124
if err != nil {
125-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.ProviderTypeName), err.Error())
125+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.FullTypeName()), err.Error())
126126
return
127127
}
128128

internal/services/copilot_studio_application_insights/resource_copilot_studio_application_insights.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func (r *Resource) Create(ctx context.Context, req resource.CreateRequest, resp
148148
// You can't really create a config, so treat a create as an update
149149
appInsightsConfigDto, err := r.CopilotStudioApplicationInsightsClient.updateCopilotStudioAppInsightsConfiguration(ctx, *appInsightsConfigToCreate, plan.BotId.ValueString())
150150
if err != nil {
151-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating/updating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
151+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating/updating %s", r.FullTypeName()), err.Error())
152152
return
153153
}
154154

@@ -180,7 +180,7 @@ func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *res
180180
resp.State.RemoveResource(ctx)
181181
return
182182
}
183-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
183+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", r.FullTypeName()), err.Error())
184184
return
185185
}
186186

@@ -213,7 +213,7 @@ func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp
213213
// You can't really create a config, so treat a create as an update
214214
appInsightsConfigDto, err := r.CopilotStudioApplicationInsightsClient.updateCopilotStudioAppInsightsConfiguration(ctx, *appInsightsConfigToCreate, plan.BotId.ValueString())
215215
if err != nil {
216-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating/updating %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
216+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when creating/updating %s", r.FullTypeName()), err.Error())
217217
return
218218
}
219219

@@ -251,7 +251,7 @@ func (r *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp
251251

252252
_, err = r.CopilotStudioApplicationInsightsClient.updateCopilotStudioAppInsightsConfiguration(ctx, *appInsightsConfigToCreate, state.BotId.ValueString())
253253
if err != nil {
254-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s_%s", r.ProviderTypeName, r.TypeName), err.Error())
254+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when deleting %s", r.FullTypeName()), err.Error())
255255
return
256256
}
257257
resp.State.RemoveResource(ctx)

internal/services/currencies/datasource_currencies.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (d *DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp
123123

124124
currencies, err := d.CurrenciesClient.GetCurrenciesByLocation(ctx, state.Location.ValueString())
125125
if err != nil {
126-
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.ProviderTypeName), err.Error())
126+
resp.Diagnostics.AddError(fmt.Sprintf("Client error when reading %s", d.FullTypeName()), err.Error())
127127
return
128128
}
129129
state.Location = types.StringValue(state.Location.ValueString())

internal/services/data_record/datasource_data_record.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (d *DataRecordDataSource) Read(ctx context.Context, req datasource.ReadRequ
210210
var state DataRecordListDataSourceModel
211211
var config DataRecordListDataSourceModel
212212

213-
tflog.Debug(ctx, fmt.Sprintf("READ RESOURCE START: %s", d.ProviderTypeName))
213+
tflog.Debug(ctx, fmt.Sprintf("READ RESOURCE START: %s", d.FullTypeName()))
214214

215215
resp.Diagnostics.Append(resp.State.Get(ctx, &state)...)
216216
resp.Diagnostics.Append(req.Config.Get(ctx, &config)...)
@@ -259,7 +259,7 @@ func (d *DataRecordDataSource) Read(ctx context.Context, req datasource.ReadRequ
259259
rows, _ := types.TupleValue(elementTypes, elements)
260260
state.Rows = types.DynamicValue(rows)
261261

262-
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE END: %s", d.ProviderTypeName))
262+
tflog.Debug(ctx, fmt.Sprintf("READ DATASOURCE END: %s", d.FullTypeName()))
263263
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
264264

265265
if resp.Diagnostics.HasError() {

0 commit comments

Comments
 (0)