зеркало из https://github.com/stride3d/nunitlite.git
AsyncInvocationRegion: Check if Exception.InternalPreserveStackTrace really exists.
This commit is contained in:
Родитель
ba255da522
Коммит
9be669e438
|
@ -14,7 +14,7 @@ namespace NUnit.Framework.Internal
|
|||
|
||||
static AsyncInvocationRegion()
|
||||
{
|
||||
PreserveStackTrace = (Action<Exception>)Delegate.CreateDelegate(typeof(Action<Exception>), PreserveStackTraceMethod);
|
||||
PreserveStackTrace = PreserveStackTraceMethod != null ? (Action<Exception>)Delegate.CreateDelegate(typeof(Action<Exception>), PreserveStackTraceMethod) : null;
|
||||
}
|
||||
|
||||
private AsyncInvocationRegion()
|
||||
|
@ -85,6 +85,7 @@ at wrapping a non-async method invocation in an async region was done");
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (PreserveStackTrace != null)
|
||||
PreserveStackTrace(e);
|
||||
throw;
|
||||
}
|
||||
|
@ -109,6 +110,7 @@ at wrapping a non-async method invocation in an async region was done");
|
|||
{
|
||||
IList<Exception> innerExceptions = GetAllExceptions(e.InnerException);
|
||||
|
||||
if (PreserveStackTrace != null)
|
||||
PreserveStackTrace(innerExceptions[0]);
|
||||
throw innerExceptions[0];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче