Skip to main content

PacketDecodeException

sealed class

The exception that is thrown when a packet cannot be decoded into its packet type.

Declaration

public sealed class PacketDecodeException : Exception
NamespaceMcProtoNet.Protocol
AssemblyMcProtoNet.Protocol.dll
Sourcesrc/McProtoNet.Protocol/Flow/PacketExceptions.cs#L6 ↗

Inheritance: ObjectPacketDecodeException

Constructors

SignatureDescription
PacketDecodeException(Type packetType, DecodeError error, Exception? inner = null)Initializes a new instance of the PacketDecodeException class with the specified packet type, error and inner exception.

PacketDecodeException(Type, DecodeError, Exception?)

public PacketDecodeException(Type packetType, DecodeError error, Exception? inner = null)

Initializes a new instance of the PacketDecodeException class with the specified packet type, error and inner exception.

Parameters: packetType (Type), error (DecodeError), inner (Exception)

Properties

SignatureDescription
DecodeError ErrorGets the reason the decode failed.
Type PacketTypeGets the packet type that failed to decode.

Error

public DecodeError Error { get; }

Gets the reason the decode failed.

Returns: DecodeError

PacketType

public Type PacketType { get; }

Gets the packet type that failed to decode.

Returns: Type