Skip to content

Commit

Permalink
add verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
avi-berkowitz-zocdoc committed Dec 28, 2017
1 parent 5780cec commit 9379753
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion model/Models/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ public void ImportData(string conn, string filename) {
var row = dt.NewRow();
var fields = (new String(line.ToArray())).Split(new[] { fieldSeparator }, StringSplitOptions.None);
if (fields.Length != dt.Columns.Count) {
throw new DataFileException("Incorrect number of columns", filename, linenumber);
var columnNames = dt.Columns.OfType<DataColumn>().Select(c => $"({c.ColumnName} ({c.DataType})").ToArray();
var details = $"fields.Length: {fields.Length}, Columns.Count: {dt.Columns.Count}, Column Names: {string.Join(",", columnNames)}";
throw new DataFileException($"Incorrect number of columns, {details}", filename, linenumber);
}
for (var j = 0; j < fields.Length; j++) {
try {
Expand Down

0 comments on commit 9379753

Please sign in to comment.