@@ -1,23 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wino.Core.Domain.Extensions;
|
||||
|
||||
public static class ExceptionExtensions
|
||||
namespace Wino.Core.Domain.Extensions
|
||||
{
|
||||
public static IEnumerable<Exception> GetInnerExceptions(this Exception ex)
|
||||
public static class ExceptionExtensions
|
||||
{
|
||||
if (ex == null)
|
||||
public static IEnumerable<Exception> GetInnerExceptions(this Exception ex)
|
||||
{
|
||||
throw new ArgumentNullException("ex");
|
||||
}
|
||||
if (ex == null)
|
||||
{
|
||||
throw new ArgumentNullException("ex");
|
||||
}
|
||||
|
||||
var innerException = ex;
|
||||
do
|
||||
{
|
||||
yield return innerException;
|
||||
innerException = innerException.InnerException;
|
||||
var innerException = ex;
|
||||
do
|
||||
{
|
||||
yield return innerException;
|
||||
innerException = innerException.InnerException;
|
||||
}
|
||||
while (innerException != null);
|
||||
}
|
||||
while (innerException != null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user