From 9c4f7afa068aa550276b40d45fc8cea7068eaa53 Mon Sep 17 00:00:00 2001 From: Halgari Date: Fri, 30 Sep 2022 23:28:36 -0600 Subject: [PATCH] Don't --- CHANGELOG.md | 1 + .../View Models/Gallery/ModListMetadataVM.cs | 34 +++++++++++++------ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cabe541..bdb2a663 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Fix some status messages during installation * Optimize the modlist optimizer so runs a bit faster * Rework the file hash cache so it doesn't block the UI thread +* Errors when downloading modlists no longer cause the app to crash #### Version - 3.0.1.7 - 9/27/2022 * HOTFIX: fix "Could not find part of path" bug related to the profiles folder diff --git a/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs b/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs index af7d97cb..664177a8 100644 --- a/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs +++ b/Wabbajack.App.Wpf/View Models/Gallery/ModListMetadataVM.cs @@ -173,18 +173,30 @@ namespace Wabbajack private async Task Download() { - Status = ModListStatus.Downloading; - - using var ll = LoadingLock.WithLoading(); - var (progress, task) = _maintainer.DownloadModlist(Metadata); - var dispose = progress - .BindToStrict(this, vm => vm.ProgressPercent); + try + { + Status = ModListStatus.Downloading; - await task; - - await _wjClient.SendMetric("downloading", Metadata.Title); - await UpdateStatus(); - dispose.Dispose(); + using var ll = LoadingLock.WithLoading(); + var (progress, task) = _maintainer.DownloadModlist(Metadata); + var dispose = progress + .BindToStrict(this, vm => vm.ProgressPercent); + try + { + await _wjClient.SendMetric("downloading", Metadata.Title); + await task; + await UpdateStatus(); + } + finally + { + dispose.Dispose(); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "While downloading {Modlist}", Metadata.RepositoryName); + await UpdateStatus(); + } } private async Task UpdateStatus()