Skip to content

Commit dce7c87

Browse files
committed
update error message
1 parent c7d5ae2 commit dce7c87

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

internal/fwserver/server_closeephemeralresource.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ func (s *Server) CloseEphemeralResource(ctx context.Context, req *CloseEphemeral
5656

5757
resourceWithClose, ok := req.EphemeralResource.(ephemeral.EphemeralResourceWithClose)
5858
if !ok {
59-
// TODO: this diagnostic should be more worded towards a core or plugin-framework bug.
60-
// Either something is bugged in core and called close incorrectly, or the framework populated
61-
// the is_closable response field incorrectly.
59+
// The framework automatically sets the indicator to Terraform core that enables calling close using
60+
// this interface, so if we get this diagnostic then there is a bug in either Terraform core or framework.
6261
resp.Diagnostics.AddError(
6362
"Ephemeral Resource Close Not Implemented",
64-
"This ephemeral resource does not support close. Please contact the provider developer for additional information.",
63+
"An unexpected error was encountered when closing the ephemeral resource. Terraform sent a close request for an "+
64+
"ephemeral resource that has not implemented close logic.\n\n"+
65+
"This is always a problem with Terraform or terraform-plugin-framework. Please report this to the provider developer.",
6566
)
6667
return
6768
}

internal/fwserver/server_closeephemeralresource_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ func TestServerCloseEphemeralResource(t *testing.T) {
193193
Diagnostics: diag.Diagnostics{
194194
diag.NewErrorDiagnostic(
195195
"Ephemeral Resource Close Not Implemented",
196-
"This ephemeral resource does not support close. Please contact the provider developer for additional information.",
196+
"An unexpected error was encountered when closing the ephemeral resource. Terraform sent a close request for an "+
197+
"ephemeral resource that has not implemented close logic.\n\n"+
198+
"This is always a problem with Terraform or terraform-plugin-framework. Please report this to the provider developer.",
197199
),
198200
},
199201
},

internal/fwserver/server_renewephemeralresource.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ func (s *Server) RenewEphemeralResource(ctx context.Context, req *RenewEphemeral
6060

6161
resourceWithRenew, ok := req.EphemeralResource.(ephemeral.EphemeralResourceWithRenew)
6262
if !ok {
63-
// TODO: this diagnostic should be more worded towards an invalid implementation or core bug.
64-
// Either something is bugged in core and called renew incorrectly, or the provider populated
65-
// the RenewAt response field without defining the renew function (invalid implementation).
6663
resp.Diagnostics.AddError(
6764
"Ephemeral Resource Renew Not Implemented",
68-
"This ephemeral resource does not support renew. Please contact the provider developer for additional information.",
65+
"An unexpected error was encountered when renewing the ephemeral resource. Terraform sent a renewal request for an "+
66+
"ephemeral resource that has not implemented renewal logic.\n\n"+
67+
"Please report this to the provider developer.",
6968
)
7069
return
7170
}

internal/fwserver/server_renewephemeralresource_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ func TestServerRenewEphemeralResource(t *testing.T) {
252252
Diagnostics: diag.Diagnostics{
253253
diag.NewErrorDiagnostic(
254254
"Ephemeral Resource Renew Not Implemented",
255-
"This ephemeral resource does not support renew. Please contact the provider developer for additional information.",
255+
"An unexpected error was encountered when renewing the ephemeral resource. Terraform sent a renewal request for an "+
256+
"ephemeral resource that has not implemented renewal logic.\n\n"+
257+
"Please report this to the provider developer.",
256258
),
257259
},
258260
},

0 commit comments

Comments
 (0)