Table of Contents

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 string

The message that describes the error.

received object

The received type of the message.

expected object

The 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

object

Message

public string Message

Field Value

string

ReceivedType

The received type of the message.

public object? ReceivedType

Field Value

object