Skip to content

Commit e3933e9

Browse files
committed
CSHARP-1901: Fix order of arguments to ArgumentException constructor.
1 parent 2d80f4c commit e3933e9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/MongoDB.Bson/ObjectModel/BsonDocument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ public virtual BsonDocument AddRange(IDictionary dictionary)
669669
{
670670
if (entry.Key == null)
671671
{
672-
throw new ArgumentException("keys", "A key passed to BsonDocument.AddRange is null.");
672+
throw new ArgumentException("A key passed to BsonDocument.AddRange is null.", "keys");
673673
}
674674
if (entry.Key.GetType() != typeof(string))
675675
{

src/MongoDB.Bson/Serialization/BsonDocumentBackedClass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected void SetValue(string memberName, object value)
127127
if (!_serializer.TryGetMemberSerializationInfo(memberName, out info))
128128
{
129129
var message = string.Format("The member {0} does not exist.", memberName);
130-
throw new ArgumentException("memberName", message);
130+
throw new ArgumentException(message, "memberName");
131131
}
132132

133133
var bsonValue = info.SerializeValue(value);

src/MongoDB.Driver.Core/Core/Misc/Ensure.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static T IsEqualTo<T>(T value, T comparand, string paramName)
5757
if (!value.Equals(comparand))
5858
{
5959
var message = string.Format("Value is not equal to {1}: {0}.", value, comparand);
60-
throw new ArgumentException(paramName, message);
60+
throw new ArgumentException(message, paramName);
6161
}
6262
return value;
6363
}

0 commit comments

Comments
 (0)