diff --git a/internal/provider/data_source.go b/internal/provider/data_source.go index a7b5f5ee..a8fb7820 100644 --- a/internal/provider/data_source.go +++ b/internal/provider/data_source.go @@ -73,14 +73,14 @@ func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta interface{ // Get the System Cert Pool caCertPool, err := x509.SystemCertPool() if err != nil { - return fmt.Errorf("Error tls: %s", err) + return append(diags, diag.Errorf("Error tls: %s", err)...) } // Use `ca_certificate` cert pool if caCert != "" { caCertPool = x509.NewCertPool() if ok := caCertPool.AppendCertsFromPEM([]byte(caCert)); !ok { - return fmt.Errorf("Error tls: Can't add the CA certificate to certificate pool") + return append(diags, diag.Errorf("Error tls: Can't add the CA certificate to certificate pool")...) } }