From b02f5af3e6191cb9d8f68bae6a8453d9742ff19a Mon Sep 17 00:00:00 2001 From: axunonb Date: Tue, 24 Sep 2024 09:47:22 +0200 Subject: [PATCH] Log error if Chromium could not be started --- League/Caching/ReportSheetCache.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/League/Caching/ReportSheetCache.cs b/League/Caching/ReportSheetCache.cs index 3e8dabc..3760812 100644 --- a/League/Caching/ReportSheetCache.cs +++ b/League/Caching/ReportSheetCache.cs @@ -197,13 +197,12 @@ private async Task CreateReportSheetPdfChromium(string tempFolder, strin if (proc is null) { - //_logger.LogCritical("Process '{PathToChromium}' could not be started.", _pathToChromium); - throw new InvalidOperationException($"Process '{_pathToChromium}' could not be started."); + _logger.LogError("Process '{PathToChromium}' could not be started.", _pathToChromium); } const int timeout = 8000; var timePassed = 0; - while (!proc.HasExited) + while (proc is { HasExited: false }) { timePassed += 100; await Task.Delay(100, default); @@ -213,6 +212,7 @@ private async Task CreateReportSheetPdfChromium(string tempFolder, strin throw new OperationCanceledException($"Chromium timed out after {timeout}ms."); } + // non-existing file is handled in MovePdfToCache return pdfFile; }