Exemplo n.º 1
0
        public void TrackException(Exception exception, Dictionary <string, string> properties = null)
        {
#if DEBUG
            if (Debugger.IsAttached)
            {
                Debugger.Break();
            }
#else //Workaround to the missing properties in the HockeyApp-UI.
            if (properties != null)
            {
                exception = new DecoratedHockeyAppException(exception, properties.ToArray());
            }
            HockeyClient.Current.TrackException(exception, properties);
#endif
        }
Exemplo n.º 2
0
        private static string DescriptionLoader(Exception exception)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine($"HResult: {exception.HResult}");
            DecoratedHockeyAppException hockeyAppEx = exception as DecoratedHockeyAppException;

            if (hockeyAppEx != null)
            {
                exception = hockeyAppEx.InnerException;
                sb.AppendLine($"Original Exception Type: {exception.GetType().Name}");
                foreach (KeyValuePair <string, string> property in hockeyAppEx.Properties)
                {
                    sb.AppendLine($"{property.Key}: {property.Value}");
                }
            }
            sb.AppendLine();
            sb.AppendLine($"Exception String:");
            sb.AppendLine($"===========================");
            sb.AppendLine(exception.ToString());
            sb.AppendLine($"===========================");
            return(sb.ToString());
        }