From 59df3dadee6d345d8bc9634fa2eff7a328e5e43c Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Wed, 13 May 2020 17:46:24 -0600 Subject: [PATCH] Give some debug information when we have a number format exception with Nexus archives. --- Wabbajack.Lib/Downloaders/NexusDownloader.cs | 31 +++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Wabbajack.Lib/Downloaders/NexusDownloader.cs b/Wabbajack.Lib/Downloaders/NexusDownloader.cs index 6c35334c..04283602 100644 --- a/Wabbajack.Lib/Downloaders/NexusDownloader.cs +++ b/Wabbajack.Lib/Downloaders/NexusDownloader.cs @@ -79,18 +79,27 @@ namespace Wabbajack.Lib.Downloaders throw; } - return new State + try { - Name = NexusApiUtils.FixupSummary(info.name), - Author = NexusApiUtils.FixupSummary(info.author), - Version = general.version ?? "0.0.0.0", - ImageURL = info.picture_url, - IsNSFW = info.contains_adult_content, - Description = NexusApiUtils.FixupSummary(info.summary), - Game = GameRegistry.GetByFuzzyName((string)general.gameName).Game, - ModID = long.Parse(general.modID), - FileID = long.Parse(general.fileID) - }; + return new State + { + Name = NexusApiUtils.FixupSummary(info.name), + Author = NexusApiUtils.FixupSummary(info.author), + Version = general.version ?? "0.0.0.0", + ImageURL = info.picture_url, + IsNSFW = info.contains_adult_content, + Description = NexusApiUtils.FixupSummary(info.summary), + Game = GameRegistry.GetByFuzzyName((string)general.gameName).Game, + ModID = long.Parse(general.modID), + FileID = long.Parse(general.fileID) + }; + } + catch (FormatException) + { + Utils.Log( + $"Cannot parse ModID/FileID from {(string)general.gameName} {(string)general.modID} {(string)general.fileID}"); + throw; + } } return null;