diff --git a/pkg/framework/objects/azure_dev_ops_project/data_source.go b/pkg/framework/objects/azure_dev_ops_project/data_source.go index 3abfb87..5fe0e5b 100644 --- a/pkg/framework/objects/azure_dev_ops_project/data_source.go +++ b/pkg/framework/objects/azure_dev_ops_project/data_source.go @@ -64,11 +64,16 @@ func (d *azureDevOpsProjectDataSource) Read( func (d *azureDevOpsProjectDataSource) Configure( _ context.Context, req datasource.ConfigureRequest, - _ *datasource.ConfigureResponse, + resp *datasource.ConfigureResponse, ) { - if req.ProviderData == nil { - return + switch c := req.ProviderData.(type) { + case nil: // do nothing + case *dbt_cloud.Client: + d.client = c + default: + resp.Diagnostics.AddError( + "Missing client", + "A client is required to configure the Azure DevOps Project data source", + ) } - - d.client = req.ProviderData.(*dbt_cloud.Client) }