mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-22 10:46:37 +00:00
docs: add XML doc comments to Core public API and remove CS1591 suppression
- Add missing XML doc comments to all public types and members in PSProxmoxVE.Core (Authentication, Exceptions, Models, Client) - Remove CS1591 suppression from PSProxmoxVE.Core.csproj - Build succeeds with 0 warnings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,13 +3,23 @@ using System.Net;
|
||||
|
||||
namespace PSProxmoxVE.Core.Exceptions
|
||||
{
|
||||
/// <summary>Exception thrown when the Proxmox VE API returns an error response</summary>
|
||||
/// <summary>Exception thrown when the Proxmox VE API returns an error response.</summary>
|
||||
public class PveApiException : Exception
|
||||
{
|
||||
/// <summary>The HTTP status code returned by the PVE API.</summary>
|
||||
public HttpStatusCode StatusCode { get; }
|
||||
|
||||
/// <summary>The API resource path that was requested.</summary>
|
||||
public string Resource { get; }
|
||||
|
||||
/// <summary>The HTTP method used for the request (GET, POST, PUT, DELETE).</summary>
|
||||
public string HttpMethod { get; }
|
||||
|
||||
/// <summary>Initializes a new instance for a failed PVE API request.</summary>
|
||||
/// <param name="statusCode">The HTTP status code returned.</param>
|
||||
/// <param name="message">The error message from the API.</param>
|
||||
/// <param name="resource">The API resource path that was requested.</param>
|
||||
/// <param name="httpMethod">The HTTP method used.</param>
|
||||
public PveApiException(HttpStatusCode statusCode, string message, string resource, string httpMethod)
|
||||
: base($"PVE API error ({(int)statusCode} {statusCode}) on {httpMethod} {resource}: {message}")
|
||||
{
|
||||
@@ -18,6 +28,12 @@ namespace PSProxmoxVE.Core.Exceptions
|
||||
HttpMethod = httpMethod;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance for a failed PVE API request, with an inner exception.</summary>
|
||||
/// <param name="statusCode">The HTTP status code returned.</param>
|
||||
/// <param name="message">The error message from the API.</param>
|
||||
/// <param name="resource">The API resource path that was requested.</param>
|
||||
/// <param name="httpMethod">The HTTP method used.</param>
|
||||
/// <param name="innerException">The exception that caused this failure.</param>
|
||||
public PveApiException(HttpStatusCode statusCode, string message, string resource, string httpMethod, Exception innerException)
|
||||
: base($"PVE API error ({(int)statusCode} {statusCode}) on {httpMethod} {resource}: {message}", innerException)
|
||||
{
|
||||
|
||||
@@ -2,14 +2,19 @@ using System;
|
||||
|
||||
namespace PSProxmoxVE.Core.Exceptions
|
||||
{
|
||||
/// <summary>Exception thrown when authentication to a Proxmox VE server fails</summary>
|
||||
/// <summary>Exception thrown when authentication to a Proxmox VE server fails.</summary>
|
||||
public class PveAuthenticationException : Exception
|
||||
{
|
||||
/// <summary>Initializes a new instance with the specified error message.</summary>
|
||||
/// <param name="message">The error message describing the authentication failure.</param>
|
||||
public PveAuthenticationException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance with the specified error message and inner exception.</summary>
|
||||
/// <param name="message">The error message describing the authentication failure.</param>
|
||||
/// <param name="innerException">The exception that caused this failure.</param>
|
||||
public PveAuthenticationException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
|
||||
@@ -2,14 +2,17 @@ using System;
|
||||
|
||||
namespace PSProxmoxVE.Core.Exceptions
|
||||
{
|
||||
/// <summary>Exception thrown when an operation is attempted without an active Proxmox VE session</summary>
|
||||
/// <summary>Exception thrown when an operation is attempted without an active Proxmox VE session.</summary>
|
||||
public class PveNotConnectedException : Exception
|
||||
{
|
||||
/// <summary>Initializes a new instance indicating no active session exists.</summary>
|
||||
public PveNotConnectedException()
|
||||
: base("No active Proxmox VE session. Run Connect-PveServer first.")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance indicating no active session exists, with an inner exception.</summary>
|
||||
/// <param name="innerException">The exception that caused this failure.</param>
|
||||
public PveNotConnectedException(Exception innerException)
|
||||
: base("No active Proxmox VE session. Run Connect-PveServer first.", innerException)
|
||||
{
|
||||
|
||||
@@ -2,14 +2,17 @@ using System;
|
||||
|
||||
namespace PSProxmoxVE.Core.Exceptions
|
||||
{
|
||||
/// <summary>Exception thrown when the Proxmox VE session ticket has expired</summary>
|
||||
/// <summary>Exception thrown when the Proxmox VE session ticket has expired.</summary>
|
||||
public class PveSessionExpiredException : Exception
|
||||
{
|
||||
/// <summary>Initializes a new instance indicating the session has expired.</summary>
|
||||
public PveSessionExpiredException()
|
||||
: base("Your Proxmox VE session has expired. Please run Connect-PveServer to establish a new session.")
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance indicating the session has expired, with an inner exception.</summary>
|
||||
/// <param name="innerException">The exception that caused this failure.</param>
|
||||
public PveSessionExpiredException(Exception innerException)
|
||||
: base("Your Proxmox VE session has expired. Please run Connect-PveServer to establish a new session.", innerException)
|
||||
{
|
||||
|
||||
@@ -2,12 +2,18 @@ using System;
|
||||
|
||||
namespace PSProxmoxVE.Core.Exceptions
|
||||
{
|
||||
/// <summary>Exception thrown when a Proxmox VE task completes with a failed exit status</summary>
|
||||
/// <summary>Exception thrown when a Proxmox VE task completes with a failed exit status.</summary>
|
||||
public class PveTaskFailedException : Exception
|
||||
{
|
||||
/// <summary>The UPID of the failed task.</summary>
|
||||
public string Upid { get; }
|
||||
|
||||
/// <summary>The exit status string reported by the task (e.g., an error message).</summary>
|
||||
public string ExitStatus { get; }
|
||||
|
||||
/// <summary>Initializes a new instance for a task that failed with the specified exit status.</summary>
|
||||
/// <param name="upid">The UPID of the failed task.</param>
|
||||
/// <param name="exitStatus">The exit status string reported by the task.</param>
|
||||
public PveTaskFailedException(string upid, string exitStatus)
|
||||
: base($"Task {upid} failed with exit status: {exitStatus}")
|
||||
{
|
||||
@@ -15,6 +21,10 @@ namespace PSProxmoxVE.Core.Exceptions
|
||||
ExitStatus = exitStatus;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance for a task that failed, with an inner exception.</summary>
|
||||
/// <param name="upid">The UPID of the failed task.</param>
|
||||
/// <param name="exitStatus">The exit status string reported by the task.</param>
|
||||
/// <param name="innerException">The exception that caused this failure.</param>
|
||||
public PveTaskFailedException(string upid, string exitStatus, Exception innerException)
|
||||
: base($"Task {upid} failed with exit status: {exitStatus}", innerException)
|
||||
{
|
||||
|
||||
@@ -2,12 +2,18 @@ using System;
|
||||
|
||||
namespace PSProxmoxVE.Core.Exceptions
|
||||
{
|
||||
/// <summary>Exception thrown when a Proxmox VE task does not complete within the allowed timeout period</summary>
|
||||
/// <summary>Exception thrown when a Proxmox VE task does not complete within the allowed timeout period.</summary>
|
||||
public class PveTaskTimeoutException : Exception
|
||||
{
|
||||
/// <summary>The UPID of the task that timed out.</summary>
|
||||
public string Upid { get; }
|
||||
|
||||
/// <summary>The timeout duration that was exceeded.</summary>
|
||||
public TimeSpan Timeout { get; }
|
||||
|
||||
/// <summary>Initializes a new instance for a task that exceeded the specified timeout.</summary>
|
||||
/// <param name="upid">The UPID of the timed-out task.</param>
|
||||
/// <param name="timeout">The timeout duration that was exceeded.</param>
|
||||
public PveTaskTimeoutException(string upid, TimeSpan timeout)
|
||||
: base($"Task {upid} did not complete within {timeout.TotalSeconds} seconds.")
|
||||
{
|
||||
@@ -15,6 +21,10 @@ namespace PSProxmoxVE.Core.Exceptions
|
||||
Timeout = timeout;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance for a task that exceeded the specified timeout, with an inner exception.</summary>
|
||||
/// <param name="upid">The UPID of the timed-out task.</param>
|
||||
/// <param name="timeout">The timeout duration that was exceeded.</param>
|
||||
/// <param name="innerException">The exception that caused this failure.</param>
|
||||
public PveTaskTimeoutException(string upid, TimeSpan timeout, Exception innerException)
|
||||
: base($"Task {upid} did not complete within {timeout.TotalSeconds} seconds.", innerException)
|
||||
{
|
||||
|
||||
@@ -3,13 +3,22 @@ using PSProxmoxVE.Core.Authentication;
|
||||
|
||||
namespace PSProxmoxVE.Core.Exceptions
|
||||
{
|
||||
/// <summary>Exception thrown when the connected Proxmox VE server does not meet the minimum version requirement for an operation</summary>
|
||||
/// <summary>Exception thrown when the connected Proxmox VE server does not meet the minimum version requirement for an operation.</summary>
|
||||
public class PveVersionException : Exception
|
||||
{
|
||||
/// <summary>The minimum required major version number.</summary>
|
||||
public int RequiredMajor { get; }
|
||||
|
||||
/// <summary>The minimum required minor version number.</summary>
|
||||
public int RequiredMinor { get; }
|
||||
|
||||
/// <summary>The actual server version that did not meet the requirement.</summary>
|
||||
public PveVersion ActualVersion { get; }
|
||||
|
||||
/// <summary>Initializes a new instance for a version requirement that was not met.</summary>
|
||||
/// <param name="requiredMajor">The minimum required major version.</param>
|
||||
/// <param name="requiredMinor">The minimum required minor version.</param>
|
||||
/// <param name="actualVersion">The actual server version detected.</param>
|
||||
public PveVersionException(int requiredMajor, int requiredMinor, PveVersion actualVersion)
|
||||
: base($"This operation requires Proxmox VE {requiredMajor}.{requiredMinor} or later. Connected server is version {actualVersion}.")
|
||||
{
|
||||
@@ -18,6 +27,11 @@ namespace PSProxmoxVE.Core.Exceptions
|
||||
ActualVersion = actualVersion;
|
||||
}
|
||||
|
||||
/// <summary>Initializes a new instance for a version requirement that was not met, with an inner exception.</summary>
|
||||
/// <param name="requiredMajor">The minimum required major version.</param>
|
||||
/// <param name="requiredMinor">The minimum required minor version.</param>
|
||||
/// <param name="actualVersion">The actual server version detected.</param>
|
||||
/// <param name="innerException">The exception that caused this failure.</param>
|
||||
public PveVersionException(int requiredMajor, int requiredMinor, PveVersion actualVersion, Exception innerException)
|
||||
: base($"This operation requires Proxmox VE {requiredMajor}.{requiredMinor} or later. Connected server is version {actualVersion}.", innerException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user