BencodeSerializationException Class
Definition
- Assembly
- Bodu.Text.Bencode.dll
- Package
- Bodu.Text.Bencode 1.0.0
The exception thrown when a value cannot be bound to or from a Bencode document during serialization - for example a type mismatch, a missing required member, or a value Bencode cannot represent.
public sealed class BencodeSerializationException : Exception, ISerializable
- Inheritance
-
BencodeSerializationException
- Implements
- Inherited Members
- Extension Methods
Remarks
This exception reports a binding-level failure and is distinct from BencodeFormatException, which reports that the source bytes were not well-formed Bencode. When the failure can be traced to a position in the source bytes, BytesOffset carries it.
The two causes are deliberately kept distinct; catch both exception types when the handling should not distinguish malformed bytes from unmappable values.
Constructors
BencodeSerializationException()
Initializes a new instance of the BencodeSerializationException class.
public BencodeSerializationException()
BencodeSerializationException(string)
Initializes a new instance of the BencodeSerializationException class with the specified message.
public BencodeSerializationException(string message)
Parameters
messagestringThe message that describes the error.
BencodeSerializationException(string, Exception?)
Initializes a new instance of the BencodeSerializationException class with the specified message and a reference to the inner exception that caused it.
public BencodeSerializationException(string message, Exception? innerException)
Parameters
BencodeSerializationException(string, int)
Initializes a new instance of the BencodeSerializationException class with the specified message and source byte offset.
public BencodeSerializationException(string message, int bytesOffset)
Parameters
Properties
BytesOffset
Gets the byte offset into the source at which the error was detected, when available.
public int? BytesOffset { get; }
Property Value
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |