Class InvalidMessageException
- Namespace
- NLightning.Infrastructure.Exceptions
- Assembly
- NLightning.Infrastructure.dll
Represents an exception thrown when an invalid message is received.
[ExcludeFromCodeCoverage]
public class InvalidMessageException : Exception, ISerializable
- Inheritance
-
InvalidMessageException
- Implements
- Inherited Members
Remarks
This exception is thrown when an unknown message type is received or when a message is received that is not expected.
Constructors
InvalidMessageException(string)
Represents an exception thrown when an invalid message is received.
public InvalidMessageException(string message)
Parameters
messagestring
Remarks
This exception is thrown when an 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
messagestringThe message that describes the error.
receivedobjectThe received type of the message.
expectedobjectThe 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