From d8c3e536e111a00b04fb19f09f328f2de3b25b2b Mon Sep 17 00:00:00 2001 From: Raymond Date: Sat, 9 Oct 2021 12:05:36 -0400 Subject: [PATCH 1/2] Handle unexpected errors with plugin images. --- .../Internal/Windows/PluginInstallerWindow.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs index ec014d013..b17644861 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs @@ -2093,6 +2093,11 @@ namespace Dalamud.Interface.Internal.Windows Log.Error($"Plugin icon for {manifest.InternalName} has an Invalid URI"); return; } + catch (Exception ex) + { + Log.Error(ex, $"An unexpected error occurred with the icon for {manifest.InternalName}"); + return; + } if (data.StatusCode == HttpStatusCode.NotFound) return; @@ -2202,6 +2207,11 @@ namespace Dalamud.Interface.Internal.Windows Log.Error($"Plugin image{i + 1} for {manifest.InternalName} has an Invalid URI"); continue; } + catch (Exception ex) + { + Log.Error(ex, $"An unexpected error occurred with image{i + 1} for {manifest.InternalName}"); + continue; + } if (data.StatusCode == HttpStatusCode.NotFound) continue; From 0678dea18c43a199fe0ad95d15fb3649cf0b35ae Mon Sep 17 00:00:00 2001 From: Raymond Date: Sat, 9 Oct 2021 12:09:15 -0400 Subject: [PATCH 2/2] Handle anything else that blew up --- .../Interface/Internal/Windows/PluginInstallerWindow.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs index b17644861..87908ec35 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstallerWindow.cs @@ -1827,7 +1827,14 @@ namespace Dalamud.Interface.Internal.Windows if (!hasImages) { this.pluginImagesMap.Add(manifest.InternalName, Array.Empty()); - Task.Run(async () => await this.DownloadPluginImagesAsync(plugin, manifest, isThirdParty)); + Task.Run(async () => await this.DownloadPluginImagesAsync(plugin, manifest, isThirdParty)) + .ContinueWith(task => + { + if (task.IsFaulted) + { + Log.Error(task.Exception.InnerException, "An unhandled exception occurred in the plugin image downloader"); + } + }); return false; }