Skip to content

Commit d516902

Browse files
committed
Fix: Better error when no constructor found
1 parent 22322c4 commit d516902

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MongoDB.Bson/Serialization/Serializers/BsonClassMapSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ private BsonCreatorMap ChooseBestCreator(Dictionary<string, object> values)
462462

463463
if (creatorMap == null)
464464
{
465-
throw new BsonSerializationException("No matching creator found.");
465+
throw new BsonSerializationException($"No matching creator found for class {_classMap.ClassType.FullName}.");
466466
}
467467

468468
return creatorMap;

0 commit comments

Comments
 (0)