Skip to content

Commit bf79afe

Browse files
committed
Improved exception handling if admin node is not reachable
1 parent 739301d commit bf79afe

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/StorageGRID-Webscale.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5071,6 +5071,10 @@ function Global:Get-SgwVersion {
50715071
if ($ResponseBody -match "apiVersion") {
50725072
$ApiVersion = ($ResponseBody | ConvertFrom-Json).APIVersion
50735073
}
5074+
elseif ($_.Exception.Message -match "Device not configured") {
5075+
Write-Warning "Connection failed due to network errors. Please check if you specified the correct hostname and that you can reach the hostname."
5076+
Throw "$Method to $Uri failed with Exception $( $_.Exception.Message )"
5077+
}
50745078
else {
50755079
Write-Warning "Certificate of the server may not be trusted. Use -SkipCertificateCheck switch if you want to skip certificate verification."
50765080
Throw "$Method to $Uri failed with Exception $( $_.Exception.Message ) `n $responseBody"

0 commit comments

Comments
 (0)