Skip to content

Commit

Permalink
Merge pull request #28 from Zocdoc/avib_add_verbosity
Browse files Browse the repository at this point in the history
add verbosity
  • Loading branch information
avi-berkowitz-zocdoc authored Dec 28, 2017
2 parents 5780cec + 474b0d9 commit e533394
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:{Environment.NewLine}{string.Join(Environment.NewLine, 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 e533394

Please sign in to comment.