Table of Contents

Class ExcelParseException

Namespace
ExcelReader.Core.Parser
Assembly
ExcelReader.Core.dll

Thrown when a bound column's cell is non-empty but fails to parse into the target property type and the parser is configured to throw on parse failures (rather than silently keep the property at its default). See ThrowOnParseFailure.

public sealed class ExcelParseException : Exception, ISerializable
Inheritance
ExcelParseException
Implements
Inherited Members

Remarks

A parse failure on an [ExcelRequired] column always surfaces as a missing-required-value error instead, regardless of ThrowOnParseFailure, since the column has no usable value either way.

Constructors

ExcelParseException()

Creates an exception with no message.

[ExcludeFromCodeCoverage]
public ExcelParseException()

ExcelParseException(IReadOnlyList<string>)

Creates an exception describing required column(s) missing from the header row.

public ExcelParseException(IReadOnlyList<string> missingColumnNames)

Parameters

missingColumnNames IReadOnlyList<string>

ExcelParseException(int, string)

Creates an exception describing a required column that has no value in a given row.

public ExcelParseException(int row, string columnName)

Parameters

row int
columnName string

ExcelParseException(int, string, string)

Creates an exception describing the row, column, and raw value that failed to parse.

public ExcelParseException(int row, string columnName, string rawValue)

Parameters

row int
columnName string
rawValue string

ExcelParseException(string)

Creates an exception with the given message.

[ExcludeFromCodeCoverage]
public ExcelParseException(string message)

Parameters

message string

ExcelParseException(string, Exception)

Creates an exception with the given message and inner exception.

[ExcludeFromCodeCoverage]
public ExcelParseException(string message, Exception innerException)

Parameters

message string
innerException Exception

Properties

ColumnName

The name of the column whose value failed to parse.

public string ColumnName { get; }

Property Value

string

RawValue

The raw cell text that could not be parsed.

public string RawValue { get; }

Property Value

string

Row

The 1-based row number where the parse failure occurred (the header row is row 1).

public int Row { get; }

Property Value

int