Table of Contents

DelimitedFormatException Class

Definition

Namespace
Bodu.Text.Delimited
Assembly
Bodu.Text.Delimited.dll
Package
Bodu.Text.Delimited 1.3.0
Source
DelimitedFormatException.cs

Represents an error that occurs when delimited (CSV/TSV) data is malformed, such as an unterminated quoted field or a record whose field count violates the configured policy.

public sealed class DelimitedFormatException : FormatException, ISerializable
Inheritance
DelimitedFormatException
Implements
Inherited Members
Extension Methods

Constructors

DelimitedFormatException()

Initializes a new instance of the DelimitedFormatException class.

public DelimitedFormatException()

DelimitedFormatException(string)

Initializes a new instance of the DelimitedFormatException class.

public DelimitedFormatException(string message)

Parameters

message string

The error message.

DelimitedFormatException(string, Exception)

Initializes a new instance of the DelimitedFormatException class.

public DelimitedFormatException(string message, Exception innerException)

Parameters

message string

The error message.

innerException Exception

The inner exception.

DelimitedFormatException(string, int, int)

Initializes a new instance of the DelimitedFormatException class and records the source location at which the parse error was detected.

public DelimitedFormatException(string message, int line, int offset)

Parameters

message string

The error message.

line int

The 1-based line number at which the error occurred.

offset int

The zero-based byte offset from the start of the source.

Properties

LineNumber

Gets the 1-based line number of the parse error, when available.

public int? LineNumber { get; }

Property Value

int?

The line number, or null when no line is associated with the error.

Remarks

An error about a record as a whole, a field count that differs from the header's or a header row that repeats a column name, is reported on the line where that record starts. Other errors, such as an unterminated quoted field, are reported on the line at which the reader detected them.

Offset

Gets the zero-based byte offset of the parse error, when available.

public int? Offset { get; }

Property Value

int?

The byte offset, or null when no position is associated with the error or the offset is greater than MaxValue, as it can be in a long stream.

Remarks

An error about a record as a whole is reported at the offset of the record's first byte; other errors at the offset at which the reader detected them.

Applies to

ProductVersions
.NET8, 10