public static string GetAllMessages(this System.Exception exception)
        {
            var messages = exception.FromHierarchy(ex => ex.InnerException)
                           .Select(ex => ex.Message);

            return(string.Join(Environment.NewLine, messages));
        }
Example #2
0
 private static ModelException BuildExeption(System.Exception err, string request) =>
 new ModelException
 {
     msg        = err.FromHierarchy(ex => ex.InnerException).Select(ex => ex.Message),
     request    = request,
     source     = err.Source,
     stackTrace = err.StackTrace,
     targetSite = err.TargetSite?.DeclaringType.ToString(),
 };
Example #3
0
 public static string GetaAllMessages(this System.Exception exception)
 => string.Join(Environment.NewLine, exception.FromHierarchy(ex => ex.InnerException).Select(ex => ex.Message));