Files
Prowlarr-Prowlarr/src/Microsoft.AspNet.SignalR.Core/Infrastructure/ExceptionsExtensions.cs
2013-11-21 21:26:57 -08:00

29 lines
756 B
C#

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System;
namespace Microsoft.AspNet.SignalR.Infrastructure
{
internal static class ExceptionsExtensions
{
internal static Exception Unwrap(this Exception ex)
{
if (ex == null)
{
return null;
}
var next = ex.GetBaseException();
while (next.InnerException != null)
{
// On mono GetBaseException() doesn't seem to do anything
// so just walk the inner exception chain.
next = next.InnerException;
}
return next;
}
}
}