CollectExceptionMessages() private static method

private static CollectExceptionMessages ( Exception ex ) : string
ex System.Exception
return string
示例#1
0
        private static IDictionary <string, object> GetPropertiesFromException(Exception e, IDictionary <string, object> props)
        {
            props.Add("Messages", Utility.CollectExceptionMessages(e));
            var epath = string.Empty;

            while (e != null)
            {
                epath += e.GetType().Name + "/";
                var data = e.Data;
                foreach (var key in data.Keys)
                {
                    props.Add(epath + key, data[key]);
                }
                e = e.InnerException;
            }
            return(props);
        }
示例#2
0
        private static IDictionary <string, object> GetPropertiesFromException(Exception e, IDictionary <string, object> props)
        {
            props.Add("Messages", Utility.CollectExceptionMessages(e));
            var epath = string.Empty;

            while (e != null)
            {
                epath += e.GetType().Name + "/";
                var data = e.Data;
                foreach (var key in data.Keys)
                {
                    props.Add(epath + key, data[key]);
                }

                var rtle = e as ReflectionTypeLoadException;
                if (rtle != null)
                {
                    props.Add("Types", string.Join(", ", rtle.Types.Select(x => x.FullName)));
                }

                e = e.InnerException;
            }
            return(props);
        }