Skip to content

Commit

Permalink
add more error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassem committed Oct 9, 2023
1 parent b7c5404 commit 818637c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/scripts/Invoke-RegisterSubscriptionResourceProviders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ if ($providers.Count -gt 0) {
}
catch {
Write-Output "`n There was a problem registering the '$provider' provider. Please make sure this provider namespace is valid"
$failedProviders += ",$provider"
if ($failedProviders.length -gt 0) {
$output = $failedProviders.substring(1)
}
$DeploymentScriptOutputs["failedProvidersRegistrations"] = $output
}
# Registering resource providers features
$features = $providers[$provider]
Expand Down Expand Up @@ -75,6 +80,11 @@ if ($providers.Count -gt 0) {
}
catch {
Write-Output "`n There was a problem registering the '$feature' feature. Please make sure this feature name is valid"
$failedFeatures += ",$feature"
if ($failedFeatures.length -gt 0) {
$output = $failedFeatures.substring(1)
}
$DeploymentScriptOutputs["failedFeaturesRegistrations"] = $output
}
}
}
Expand Down

0 comments on commit 818637c

Please sign in to comment.