Exemplo n.º 1
0
        /// <summary>
        /// Devuelve un texto descriptivo de una excepción
        /// </summary>
        /// <param name="ex">excepción</param>
        /// <param name="values">lista de valores adicionales</param>
        /// <param name="config">Template y configuración del mismo</param>
        /// <returns></returns>
        public static string GetErrorFullDescription(System.Exception ex, Dictionary <string, object> values, ExceptionConvertTemplateBase config)
        {
            if (ex == null)
            {
                return(null);
            }

            values = Convert.IsNull(values, new Dictionary <string, object>());
            config = Convert.IsNull(config, new ExceptionConvertTemplateFull());


            return(config.GetFullDescription(ex, values));
        }
Exemplo n.º 2
0
            public string ToString(Exceptions.ExceptionConvertTemplateBase config)
            {
                var sb = new StringBuilder();

                foreach (var m in this)
                {
                    sb.AppendLine(string.Format("{0}: {1}",
                                                m.EsError ? "ERROR" : "INFO",
                                                m.Ex != null ? config.GetFullDescription(m.Ex, null) : m.Text
                                                ));
                }

                return(sb.ToString());
            }