Skip to content

Commit 18a309a

Browse files
committed
improve exception
1 parent 9cc5285 commit 18a309a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

YamlDotNet/Serialization/BufferedDeserialization/TypeDiscriminators/KeyValueTypeDiscriminator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public KeyValueTypeDiscriminator(Type baseType, string targetKey, IDictionary<st
3333
{
3434
if (!baseType.IsAssignableFrom(keyValuePair.Value))
3535
{
36-
throw new ArgumentOutOfRangeException($"{nameof(typeMapping)} dictionary contains type {keyValuePair.Value} which is not a assignable to {baseType}");
36+
throw new ArgumentOutOfRangeException(nameof(typeMapping), $"{keyValuePair.Value} is not a assignable to {baseType}");
3737
}
3838
}
3939
this.BaseType = baseType;

YamlDotNet/Serialization/BufferedDeserialization/TypeDiscriminators/UniqueKeyTypeDiscriminator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public UniqueKeyTypeDiscriminator(Type baseType, IDictionary<string, Type> typeM
3131
{
3232
if (!baseType.IsAssignableFrom(keyValuePair.Value))
3333
{
34-
throw new ArgumentOutOfRangeException($"{nameof(typeMapping)} dictionary contains type {keyValuePair.Value} which is not a assignable to {baseType}");
34+
throw new ArgumentOutOfRangeException(nameof(typeMapping), $"{keyValuePair.Value} is not a assignable to {baseType}");
3535
}
3636
}
3737
this.BaseType = baseType;

0 commit comments

Comments
 (0)