Class ExcelParseException
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
missingColumnNamesIReadOnlyList<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
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
ExcelParseException(string)
Creates an exception with the given message.
[ExcludeFromCodeCoverage]
public ExcelParseException(string message)
Parameters
messagestring
ExcelParseException(string, Exception)
Creates an exception with the given message and inner exception.
[ExcludeFromCodeCoverage]
public ExcelParseException(string message, Exception innerException)
Parameters
Properties
ColumnName
The name of the column whose value failed to parse.
public string ColumnName { get; }
Property Value
RawValue
The raw cell text that could not be parsed.
public string RawValue { get; }
Property Value
Row
The 1-based row number where the parse failure occurred (the header row is row 1).
public int Row { get; }