Skip to content

Commit

Permalink
[SVGThumbnails]Fix hanging loop and add logs (microsoft#31116)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed Jan 24, 2024
1 parent 172db3a commit 6f5a59b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/modules/previewpane/SvgThumbnailProvider/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Globalization;
using ManagedCommon;

namespace Microsoft.PowerToys.ThumbnailHandler.Svg
{
Expand All @@ -17,6 +18,7 @@ internal static class Program
public static void Main(string[] args)
{
ApplicationConfiguration.Initialize();
Logger.InitializeLogger("\\FileExplorer_localLow\\SvgThumbnails\\logs", true);
if (args != null)
{
if (args.Length == 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Runtime.CompilerServices;
using System.Threading;
using Common.Utilities;
using ManagedCommon;
using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms;

Expand Down Expand Up @@ -197,8 +198,10 @@ public Bitmap GetThumbnailImpl(uint cx)
_browser.NavigateToString(SvgContents);
}
}
catch (Exception)
catch (Exception ex)
{
Logger.LogError($"Failed running webView2Environment completed for {FilePath} : ", ex);
thumbnailDone.Set();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
<ProjectReference Include="..\..\..\common\GPOWrapper\GPOWrapper.vcxproj" />
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\ManagedTelemetry.csproj" />
<ProjectReference Include="..\Common\PreviewHandlerCommon.csproj" />
<ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
</ItemGroup>
</Project>

0 comments on commit 6f5a59b

Please sign in to comment.