Skip to content

Commit

Permalink
Better exception message. Related #170, #179.
Browse files Browse the repository at this point in the history
  • Loading branch information
bchavez committed Sep 27, 2018
1 parent a3d2dc9 commit d7ce654
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Bogus/Extensions/ExtensionsForPropertyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static Action<T, object> CreateSetter<T>(this PropertyInfo property)
if (property == null) throw new ArgumentNullException(nameof(property));

var setter = property.GetSetMethod(true);
if (setter == null) throw new ArgumentException("The specified property does not have a public setter.");
if (setter == null) throw new ArgumentException($"The specified property '{property.Name}' does not have a setter method.");

var genericHelper = GenericSetterCreationMethod.MakeGenericMethod(property.DeclaringType, property.PropertyType);
return (Action<T, object>)genericHelper.Invoke(null, new object[] { setter });
Expand Down

0 comments on commit d7ce654

Please sign in to comment.