Beispiel #1
0
        internal static List <string> RenderExceptions(Exception e, bool fileSystemLog = true, bool htmlOut = false, bool catched = true)
        {
            List <string> result = new List <string>();
            Dictionary <string, ExceptionToRender> exceptions = StackTrace.CompleteInnerExceptions(e, catched);
            List <string[]> headers = new List <string[]>();

            if (Dispatcher.EnvType == EnvType.Web)
            {
                headers = HttpHeaders.CompletePossibleHttpHeaders();
            }
            int i = 0;

            foreach (var item in exceptions)
            {
                //if (item.Value.Exception.StackTrace == null) continue; // why ??!!?????!? exception has always a stacktrace hasn't it?
                RenderingCollection preparedResult = StackTrace.RenderStackTraceForException(
                    item.Value, fileSystemLog, htmlOut, i
                    );
                preparedResult.Headers = headers;
                result.Add(Exceptions._renderStackRecordResult(
                               preparedResult, fileSystemLog, htmlOut
                               ));
                i++;
            }
            return(result);
        }