mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-19 09:26:17 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user