mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-12-27 16:45:47 +01:00
29 lines
756 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
|