Class WebSocketException
Provides a base exception for WebSocket errors.
public class WebSocketException : Exception, ISerializable
- Inheritance
-
WebSocketException
- Implements
- Inherited Members
Constructors
WebSocketException()
Initializes a new instance of the WebSocketException class.
public WebSocketException()
WebSocketException(int)
Initializes a new instance of the WebSocketException class with a specified status code.
public WebSocketException(int statusCode)
Parameters
statusCodeintThe status code of the exception.
WebSocketException(int, string)
Initializes a new instance of the WebSocketException class with a specified status code and error message.
public WebSocketException(int statusCode, string message)
Parameters
WebSocketException(int, string, Exception)
Initializes a new instance of the WebSocketException class with a specified status code, error message, and a reference to the inner exception that is the cause of this exception.
public WebSocketException(int statusCode, string message, Exception innerException)
Parameters
statusCodeintThe status code for the exception.
messagestringThe message for the exception.
innerExceptionExceptionThe inner exception that is the cause of this exception.
WebSocketException(SerializationInfo, StreamingContext)
Initializes a new instance of the WebSocketException class with serialized data.
protected WebSocketException(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe object that holds the serialized object data.
contextStreamingContextThe contextual information about the source or destination.
WebSocketException(string)
Initializes a new instance of the WebSocketException class with a specified error message.
public WebSocketException(string message)
Parameters
messagestringThe message for the exception.
WebSocketException(string, Exception)
Initializes a new instance of the WebSocketException class with a specified error message and a reference to the inner exception that is the cause of this exception.
public WebSocketException(string message, Exception innerException)
Parameters
messagestringThe message for the exception.
innerExceptionExceptionThe inner exception that is the cause of this exception.
Properties
StatusCode
Gets the status code.
public int StatusCode { get; }
Property Value
Methods
GetObjectData(SerializationInfo, StreamingContext)
Sets the SerializationInfo with information about the exception.
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.
contextStreamingContextThe StreamingContext that contains contextual information about the source or destination.