From d2f1fd362d3cd7c48ec42aa301880d248f10ac26 Mon Sep 17 00:00:00 2001 From: Huy Nguyen <162080607+HuyPhanNguyen@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:42:11 +1000 Subject: [PATCH] bugfix/issues-785-log waring if variable id null (#788) --- octopusdeploy_framework/resource_variable.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octopusdeploy_framework/resource_variable.go b/octopusdeploy_framework/resource_variable.go index be99f1b5..d2876380 100644 --- a/octopusdeploy_framework/resource_variable.go +++ b/octopusdeploy_framework/resource_variable.go @@ -131,8 +131,8 @@ func (r *variableTypeResource) Read(ctx context.Context, req resource.ReadReques if apiError != nil { resp.Diagnostics.AddError("unable to load variable", apiError.Error()) } else { - // If this is a non-API error - resp.Diagnostics.AddError(fmt.Sprintf("Error loading %s", schemas.VariableResourceDescription), err.Error()) + // If this is a non-API error just log warning and return early + resp.Diagnostics.AddWarning(fmt.Sprintf("Error loading %s, with variable Id [%s]", schemas.VariableResourceDescription, data.ID.ValueString()), err.Error()) } return }