Skip to content

Commit 118d298

Browse files
committed
Include comment about how throwOnError: false can still throw
1 parent e5491bf commit 118d298

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/DataProtection/DataProtection/src/XmlEncryption/XmlEncryptionExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ private static bool TryGetDecryptorType(string decryptorTypeName, [NotNullWhen(t
104104
: decryptorTypeName;
105105
try
106106
{
107+
// Some exceptions are thrown regardless of the value of throwOnError.
108+
// For example, if the type is found but cannot be loaded,
109+
// a System.TypeLoadException is thrown even if throwOnError is false.
107110
type = _getType(resolvedTypeName);
108111
return type is not null;
109112
}

0 commit comments

Comments
 (0)