diff --git a/NSspi/SSPIException.cs b/NSspi/SSPIException.cs index e440d8a..1b49e2d 100644 --- a/NSspi/SSPIException.cs +++ b/NSspi/SSPIException.cs @@ -7,25 +7,43 @@ using System.Threading.Tasks; namespace NSspi { + /// + /// The exception that is thrown when a problem occurs hwen using the SSPI system. + /// [Serializable] public class SSPIException : Exception { private SecurityStatus errorCode; private string message; - public SSPIException( SerializationInfo info, StreamingContext context ) + /// + /// Initializes a new instance of the SSPIException class with the given message and status. + /// + /// A message explaining what part of the system failed. + /// The error code observed during the failure. + public SSPIException( string message, SecurityStatus errorCode ) + { + this.message = message; + this.errorCode = errorCode; + } + + /// + /// Initializes a new instance of the SSPIException class from serialization data. + /// + /// + /// + protected SSPIException( SerializationInfo info, StreamingContext context ) : base( info, context ) { this.message = info.GetString( "messsage" ); this.errorCode = (SecurityStatus)info.GetUInt32( "errorCode" ); } - public SSPIException( string message, SecurityStatus errorCode ) - { - this.message = message; - this.errorCode = errorCode; - } - + /// + /// Serializes the exception. + /// + /// + /// public override void GetObjectData( SerializationInfo info, StreamingContext context ) { base.GetObjectData( info, context ); @@ -34,6 +52,9 @@ namespace NSspi info.AddValue( "errorCode", this.errorCode ); } + /// + /// The error code that was observed during the SSPI call. + /// public SecurityStatus ErrorCode { get @@ -42,6 +63,9 @@ namespace NSspi } } + /// + /// A human-readable message indicating the nature of the exception. + /// public override string Message { get