case 4586
This commit is contained in:
@@ -530,15 +530,15 @@ namespace AyaNova.Biz
|
||||
|
||||
//initialization
|
||||
log.LogDebug("Initializing report rendering system");
|
||||
bool AutoDownloadChromium = true;
|
||||
bool AutoDownloadBrowser = true;
|
||||
if (string.IsNullOrWhiteSpace(ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH))
|
||||
{
|
||||
log.LogDebug($"Using default Chromium browser (downloaded)");
|
||||
log.LogDebug($"Using default browser (downloaded)");
|
||||
}
|
||||
else
|
||||
{
|
||||
log.LogDebug($"Using user specified Chromium browser at {ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH}");
|
||||
AutoDownloadChromium = false;
|
||||
log.LogDebug($"Using user specified browser at {ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH}");
|
||||
AutoDownloadBrowser = false;
|
||||
}
|
||||
|
||||
var ReportJSFolderPath = Path.Combine(ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH, "resource", "rpt");
|
||||
@@ -549,7 +549,7 @@ namespace AyaNova.Biz
|
||||
var lo = new LaunchOptions { Headless = true };
|
||||
|
||||
|
||||
if (!AutoDownloadChromium)
|
||||
if (!AutoDownloadBrowser)
|
||||
{
|
||||
lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;
|
||||
/*
|
||||
@@ -570,9 +570,13 @@ namespace AyaNova.Biz
|
||||
}
|
||||
else
|
||||
{
|
||||
log.LogDebug($"Windows: Calling browserFetcher download async now:");
|
||||
log.LogDebug($"Calling browserFetcher download async now:");
|
||||
//await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
|
||||
await new BrowserFetcher(SupportedBrowser.Chromium).DownloadAsync();
|
||||
|
||||
//case 4586
|
||||
//puppeteer has gone chrome dev by default and so does puppeteersharp which tests ok so I'm going to allow the default
|
||||
//this means the files go into binary folder under Chrome and ChromeHeadlessShell
|
||||
await new BrowserFetcher().DownloadAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -621,12 +625,13 @@ namespace AyaNova.Biz
|
||||
case ConsoleType.Error:
|
||||
try
|
||||
{
|
||||
|
||||
//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<object>(", ", 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
|
||||
//ok, I tested it with an exception and it worked just find so shrug emoji
|
||||
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<object>(", ", errorArgs)}]");
|
||||
}
|
||||
catch { }
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user