-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw custom exception when column not found (#543)
Co-authored-by: Paweł Szybiak <[email protected]>
- Loading branch information
Showing
3 changed files
with
121 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace MiniExcelLibs.Exceptions | ||
{ | ||
public class ExcelColumnNotFoundException : KeyNotFoundException | ||
{ | ||
public string ColumnName { get; set; } | ||
public string[] ColumnAliases { get; } | ||
public string ColumnIndex { get; set; } | ||
public int RowIndex { get; set; } | ||
public IDictionary<string, int> Headers { get; } | ||
public object RowValues { get; set; } | ||
|
||
public ExcelColumnNotFoundException(string columnIndex, string columnName, string[] columnAliases, int rowIndex, IDictionary<string, int> headers, object value, string message) : base(message) | ||
{ | ||
ColumnIndex = columnIndex; | ||
ColumnName = columnName; | ||
ColumnAliases = columnAliases; | ||
RowIndex = rowIndex; | ||
Headers = headers; | ||
RowValues = value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters