Check-in [1e71405b77]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge dotnet into dotnet/timers (error reporting improvements).
Timelines: family | ancestors | descendants | both | dotnet/timers
Files: files | file ages | folders
SHA1: 1e71405b77f301848b84985406a6a8e6100dc8a2
User & Date: tinus 2019-09-14 05:54:51
Wiki:dotnet/timers
Context
2019-09-26
06:55
Merge dotnet into dotnet/timers. check-in: c3c2517228 user: tinus tags: mistake
2019-09-14
05:54
Merge dotnet into dotnet/timers (error reporting improvements). Leaf check-in: 1e71405b77 user: tinus tags: dotnet/timers
05:53
Better reporting of Uglify errors. check-in: 6cdbea3412 user: tinus tags: dotnet
2019-09-13
19:03
Fixed timers (they weren't moved with the rest of the code :-P) check-in: 93688da7bc user: tinus tags: dotnet/timers
Changes

Changes to MailSynchronizer.cs.

563
564
565
566
567
568
569
570


















571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
                else
                    bodyText = "";
                var errors = new List<Exception>();
                try
                {
                    try
                    {
                        bodyText += NUglify.Uglify.HtmlToText(sourceMsg.HtmlBody, NUglify.Html.HtmlToTextOptions.KeepStructure).Code.Trim();


















                        return bodyText;
                    }
                    catch (Exception ex)
                    {
                        errors.Add(ex);
                    }
                    try
                    {
                        var html = sourceMsg.HtmlBody;
                        // The HtmlConverter is known to sometimes get stuck in an infinite loop, so wait for a finite amount of time
                        using(var timeoutTokenSource = new CancellationTokenSource())
                        {
                            var task = Task.Run(() => new ReverseMarkdown.Converter(_htmlConverterConfig).Convert(html).TrimEnd(), timeoutTokenSource.Token);
                            if (task.Wait(300000))
                            {
                                task.Dispose();
                            }







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









|







563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
                else
                    bodyText = "";
                var errors = new List<Exception>();
                try
                {
                    try
                    {
                        var result = NUglify.Uglify.HtmlToText(sourceMsg.HtmlBody, NUglify.Html.HtmlToTextOptions.KeepStructure);
                        if (result.Code == null && result.HasErrors)
                        {
                            var errList = result.Errors.Select(error =>
                                new Exception($"Error {error.ErrorCode} ({error.ErrorNumber}) between line {error.StartLine},"
                                            + $" column {error.StartColumn} and line {error.EndLine}, column {error.EndColumn}: {error.Message}")
                                {
                                    Source = nameof(NUglify.Uglify),
                                });
                            if (errList.Count() == 1)
                            {
                                throw errList.First();
                            }
                            else
                            {
                                throw new AggregateException(errList);
                            }
                        }
                        bodyText += result.Code.Trim();
                        return bodyText;
                    }
                    catch (Exception ex)
                    {
                        errors.Add(ex);
                    }
                    try
                    {
                        var html = sourceMsg.HtmlBody;
                        // This HtmlConverter is known to sometimes get stuck in an infinite loop, so wait for a finite amount of time
                        using(var timeoutTokenSource = new CancellationTokenSource())
                        {
                            var task = Task.Run(() => new ReverseMarkdown.Converter(_htmlConverterConfig).Convert(html).TrimEnd(), timeoutTokenSource.Token);
                            if (task.Wait(300000))
                            {
                                task.Dispose();
                            }