fix: use specific exception types in catch blocks

Replaced 5 bare catch blocks with specific exception types:
- PveHttpClient: catch JsonException for JSON parse fallback
- PveCmdletBase: catch Exception with filter excluding OOM/SOE for polling
- VmService/ContainerService: catch PveApiException|HttpRequestException
  for offline node handling
- GetPveVmCmdlet: catch PveApiException for VM enrichment failures

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-22 08:14:51 -05:00
parent 379e6d2ada
commit ec8f3a86e2
5 changed files with 47 additions and 47 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ namespace PSProxmoxVE.Core.Client
if (!string.IsNullOrWhiteSpace(message))
return message!;
}
catch
catch (Newtonsoft.Json.JsonException)
{
// If parsing fails, fall through to returning the raw body (truncated)
}