Table of Contents

Class CsvParseException

Namespace
FlameCsv.Exceptions
Assembly
FlameCsv.Core.dll

Represents an error of an unparseable value.

public sealed class CsvParseException : Exception, ISerializable
Inheritance
CsvParseException
Implements

Remarks

Initializes an exception representing an unparseable value.

Constructors

CsvParseException(string?, Exception?)

Represents an error of an unparseable value.

public CsvParseException(string? message = null, Exception? innerException = null)

Parameters

message string
innerException Exception

Remarks

Initializes an exception representing an unparseable value.

Properties

Converter

Converter instance.

public object? Converter { get; set; }

Property Value

object

FieldIndex

Index of the field in the record.

public int? FieldIndex { get; init; }

Property Value

int?

FieldPosition

Start position of the field where the exception occurred.

public long? FieldPosition { get; set; }

Property Value

long?

FieldValue

Raw value of the field as a string.

public string? FieldValue { get; set; }

Property Value

string

Line

Line of the record where the exception occurred.

public int? Line { get; set; }

Property Value

int?

Message

Gets a message that describes the current exception.

public override string Message { get; }

Property Value

string

The error message that explains the reason for the exception, or an empty string ("").

RecordPosition

Start position of the record where the exception occurred.

public long? RecordPosition { get; set; }

Property Value

long?

RecordValue

Raw value of the record as a string.

public string? RecordValue { get; set; }

Property Value

string

Target

If available, name of the target property, field, or parameter.

public string? Target { get; init; }

Property Value

string

TargetType

Target type of the conversion.

public Type? TargetType { get; init; }

Property Value

Type

Methods

Throw(int, Type, object, string)

Throws an exception for a field that could not be parsed.

[DoesNotReturn]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void Throw(int fieldIndex, Type parsedType, object converter, string target)

Parameters

fieldIndex int

Index of the field in the record

parsedType Type

Converted type

converter object

Converter used

target string

If available, name of the target

Exceptions

CsvParseException