<PackageReference Include="Relativity.Server.Transfer.SDK" Version="7.7.0" />

ExceptionExtensions

static class ExceptionExtensions
using System; namespace Relativity.Transfer.Extensions { internal static class ExceptionExtensions { internal const int _MALWARE_HRESULT = -2147024671; internal const int _VIRUS_DELETED_HRESULT = -2147024670; public static bool ContainsAntiMalwareEvent(this Exception ex) { return ex.Any(delegate(Exception x) { if (x.HResult != -2147024671) return x.HResult == -2147024670; return true; }); } private static bool Any(this Exception source, Func<Exception, bool> func) { if (source == null) return false; AggregateException ex = source as AggregateException; if (ex != null) { foreach (Exception innerException in ex.InnerExceptions) { if (innerException.Any(func)) return true; } } if (func(source)) return true; if (source.InnerException != null) return source.InnerException.Any(func); return false; } } }