Browse Source

File was not added

pull/131/head
Sebastian Stehle 9 years ago
parent
commit
44ca50cb7d
  1. 27
      src/Squidex.Infrastructure/ExceptionHelper.cs

27
src/Squidex.Infrastructure/ExceptionHelper.cs

@ -0,0 +1,27 @@
// ==========================================================================
// ExceptionHelper.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
using System;
namespace Squidex.Infrastructure
{
public static class ExceptionHelper
{
public static bool Is<T>(this Exception ex) where T : Exception
{
if (ex is AggregateException aggregateException)
{
aggregateException = aggregateException.Flatten();
return aggregateException.InnerExceptions.Count == 1 && Is<T>(aggregateException.InnerExceptions[0]);
}
return ex is OperationCanceledException;
}
}
}
Loading…
Cancel
Save