Class InvalidMessageException
- Namespace
- NLightning.Bolts.Exceptions
- Assembly
- NLightning.Bolts.dll
Represents an exception that is thrown when an invalid message is received.
public class InvalidMessageException : Exception, ISerializable
- Inheritance
-
InvalidMessageException
- Implements
- Inherited Members
Remarks
This exception is thrown when a unknown message type is received or when a message is received that is not expected.
Constructors
InvalidMessageException(string)
Represents an exception that is thrown when an invalid message is received.
public InvalidMessageException(string message)
Parameters
message
string
Remarks
This exception is thrown when a unknown message type is received or when a message is received that is not expected.
InvalidMessageException(string, object, object?)
Initializes a new instance of the InvalidMessageException class.
public InvalidMessageException(string message, object received, object? expected = null)
Parameters
message
stringThe message that describes the error.
received
objectThe received type of the message.
expected
objectThe expected type of the message.
Remarks
If the message contains placeholders for types, the message will be formatted. Like this: "Received type {0} but expected type {1}"
Fields
ExpectedType
The expected type of the message.
public object? ExpectedType
Field Value
Message
public string Message
Field Value
ReceivedType
The received type of the message.
public object? ReceivedType