From 557241b0e5d861378f445dd8990a68cfbc871f32 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 10 May 2024 00:09:48 +0000 Subject: [PATCH] case 4586 - got to build point without error all dependencies updated but reporting error handling work to be done and not tested at all yet --- server/AyaNova/biz/ReportBiz.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/server/AyaNova/biz/ReportBiz.cs b/server/AyaNova/biz/ReportBiz.cs index 71c8e582..bd40eeef 100644 --- a/server/AyaNova/biz/ReportBiz.cs +++ b/server/AyaNova/biz/ReportBiz.cs @@ -11,6 +11,7 @@ using EnumsNET; using PuppeteerSharp; using Newtonsoft.Json.Linq; using System; +using StackExchange.Profiling.Internal; namespace AyaNova.Biz { @@ -570,7 +571,8 @@ namespace AyaNova.Biz else { log.LogDebug($"Windows: Calling browserFetcher download async now:"); - await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision); + //await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision); + await new BrowserFetcher(SupportedBrowser.Chromium).DownloadAsync(); } @@ -611,15 +613,20 @@ namespace AyaNova.Biz try { //info and error logging - page.Console += async (sender, args) => + //case 4586 not calling task whenall now means non async so this page.Console += async (sender, args) => is now this: + page.Console += (sender, args) => { switch (args.Message.Type) { case ConsoleType.Error: try { - var errorArgs = await Task.WhenAll(args.Message.Args.Select(arg => arg.ExecutionContext.EvaluateFunctionAsync("(arg) => arg instanceof Error ? arg.message : arg", arg))); - PageLog.AppendLine($"ERROR: {args.Message.Text} args: [{string.Join(", ", errorArgs)}]"); + + //case 4586 todo force an error here and see what we can do with it old vs new behaviour test on current release same report with erorr triggered + PageLog.AppendLine($"ERROR: {args.Message.Text}"); + //case 4586 this no longer works due to no executioncontext in arg in teh block below + // var errorArgs = await Task.WhenAll(args.Message.Args.Select(arg => arg.ExecutionContext.EvaluateFunctionAsync("(arg) => arg instanceof Error ? arg.message : arg", arg))); + // PageLog.AppendLine($"ERROR: {args.Message.Text} args: [{string.Join(", ", errorArgs)}]"); } catch { } break;