Imported Upstream version 5.14.0.125

Former-commit-id: 436f655dff8d8f7c7b0eb3cb3c65e14ccf98b295
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-06-07 18:52:37 +00:00
parent 54c0c51795
commit 413682e1ba
45 changed files with 89 additions and 319 deletions

View File

@@ -0,0 +1,31 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
namespace System.Runtime.Serialization
{
partial class DiagnosticUtility
{
internal static bool IsFatal(Exception exception)
{
while (exception != null)
{
// These exceptions aren't themselves fatal, but since the CLR uses them to wrap other exceptions,
// we want to check to see whether they've been used to wrap a fatal exception. If so, then they
// count as fatal.
if (exception is TypeInitializationException)
{
exception = exception.InnerException;
}
else
{
break;
}
}
return false;
}
}
}