diff --git a/internal/broker/utilities.go b/internal/broker/utilities.go index 87f66a95..ff62c698 100644 --- a/internal/broker/utilities.go +++ b/internal/broker/utilities.go @@ -176,12 +176,12 @@ func client(providerData *providerData) (*semp.Client, diag.Diagnostic) { } } url, err := stringWithDefaultFromEnv(providerData.Url, "url") - if url == "" { - return nil, diag.NewErrorDiagnostic("`url` attribute must be defined in a provider block or set as an environment variable (`SOLACEBROKER_URL`)", semp.ErrProviderParametersError.Error()) - } if err != nil { return nil, diag.NewErrorDiagnostic("Unable to parse provider attribute", err.Error()) } + if url == "" { + return nil, diag.NewErrorDiagnostic("`url` attribute must be defined in a provider block or set as an environment variable (`SOLACEBROKER_URL`)", semp.ErrProviderParametersError.Error()) + } retries, err := int64WithDefaultFromEnv(providerData.Retries, "retries", semp.DefaultRetries) if err != nil { return nil, diag.NewErrorDiagnostic("Unable to parse provider attribute", err.Error())