private static GetLastNonErrorManagerCodeLocation ( System.Exception e ) : string | ||
e | System.Exception | |
Résultat | string |
private static string GetLastNonErrorManagerCodeLocation(Exception e)
{
string[] stack = e.StackTrace.Split(new[] { '\n', '\n' }, StringSplitOptions.RemoveEmptyEntries);
int i = 0;
for (; i < stack.Length; i++)
{
string t = stack[i];
if (!t.Contains(nameof(ErrorManager)))
return t;
}
return stack.LastOrDefault() ?? "<Uknown>";
}