MsQuicException Class

The exception that MsQuic operations throw when the connection, a stream or a datagram fails.

public sealed class MsQuicException : IOException
Inheritance
IOException MsQuicException

Constructors

NameDescription
MsQuicException()Initializes a new instance of the MsQuicException class.
MsQuicException(MsQuicError, long?, long?, string)Initializes a new instance of the MsQuicException class.
MsQuicException(MsQuicError, long?, long?, string, Exception?)Initializes a new instance of the MsQuicException class.
MsQuicException(string)Initializes a new instance of the MsQuicException class.
MsQuicException(string, Exception?)Initializes a new instance of the MsQuicException class.

MsQuicException overloads

MsQuicException()

MsQuicException.cs

Initializes a new instance of the MsQuicException class.

public MsQuicException()

MsQuicException(MsQuicError, long?, long?, string)

MsQuicException.cs

Initializes a new instance of the MsQuicException class.

public MsQuicException(MsQuicError error, long? applicationErrorCode, long? transportErrorCode, string message)
Parameters
error MsQuicError
applicationErrorCode long?
transportErrorCode long?
message string

MsQuicException(MsQuicError, long?, long?, string, Exception?)

MsQuicException.cs

Initializes a new instance of the MsQuicException class.

public MsQuicException(MsQuicError error, long? applicationErrorCode, long? transportErrorCode, string message, Exception? innerException)
Parameters
error MsQuicError
applicationErrorCode long?
transportErrorCode long?
message string
innerException Exception?

MsQuicException(string)

MsQuicException.cs

Initializes a new instance of the MsQuicException class.

public MsQuicException(string message)
Parameters
message string

MsQuicException(string, Exception?)

MsQuicException.cs

Initializes a new instance of the MsQuicException class.

public MsQuicException(string message, Exception? innerException)
Parameters
message string
innerException Exception?

Properties

NameDescription
ApplicationErrorCodeGets the application error code the peer sent when it closed the connection or aborted the stream.
ErrorGets the kind of error.
NativeErrorCodeGets the QUIC_STATUS value MsQuic returned, if any. It depends on the operating system.
TransportErrorCodeGets the QUIC transport error code (RFC 9000, section 20.1) of a connection closed by the transport.

ApplicationErrorCode

MsQuicException.cs

Gets the application error code the peer sent when it closed the connection or aborted the stream.

public long? ApplicationErrorCode { get; }

Property value

long?

Gets the kind of error.

public MsQuicError Error { get; }

Property value

MsQuicError

NativeErrorCode

MsQuicException.cs

Gets the QUIC_STATUS value MsQuic returned, if any. It depends on the operating system.

public int? NativeErrorCode { get; init; }

Property value

int?

TransportErrorCode

MsQuicException.cs

Gets the QUIC transport error code (RFC 9000, section 20.1) of a connection closed by the transport.

public long? TransportErrorCode { get; }

Property value

long?