Skip to content

Commit 0ee5e2f

Browse files
author
electricessence
committed
More verbose error handling.
1 parent ea7bcf0 commit 0ee5e2f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Transformer.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ public Processor(Transformer<T> transformer, string[] names = null)
5656
var p = _propertySetters[i];
5757
if (p != null)
5858
{
59-
var name = _names[i];
6059
var value = record[i];
6160
if (value == DBNull.Value) value = null;
62-
p(model, value);
63-
}
61+
try
62+
{
63+
p(model, value);
64+
}
65+
catch(Exception ex)
66+
{
67+
throw new InvalidOperationException($"Unable to set value of property '{_names[i]}'.", ex);
68+
}
69+
}
6470
}
6571

6672
return model;

0 commit comments

Comments
 (0)