From 8c4a1dd1254b7b8a3796310291e366bf71d0e69d Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Thu, 21 May 2020 22:21:32 -0600 Subject: [PATCH] a bit of code cleanup --- Wabbajack.Lib/Downloaders/HTTPDownloader.cs | 2 +- Wabbajack.Server.Test/ModListValidationTests.cs | 4 ++-- Wabbajack.Server/Services/ListValidator.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Wabbajack.Lib/Downloaders/HTTPDownloader.cs b/Wabbajack.Lib/Downloaders/HTTPDownloader.cs index 6bdc210e..f92d3cbd 100644 --- a/Wabbajack.Lib/Downloaders/HTTPDownloader.cs +++ b/Wabbajack.Lib/Downloaders/HTTPDownloader.cs @@ -102,7 +102,7 @@ namespace Wabbajack.Lib.Downloaders TOP: if (!response.IsSuccessStatusCode) - throw new HttpException((int)response.StatusCode, response.ReasonPhrase); + return false; Stream stream; try diff --git a/Wabbajack.Server.Test/ModListValidationTests.cs b/Wabbajack.Server.Test/ModListValidationTests.cs index 0396a632..d36b5bcd 100644 --- a/Wabbajack.Server.Test/ModListValidationTests.cs +++ b/Wabbajack.Server.Test/ModListValidationTests.cs @@ -54,7 +54,7 @@ namespace Wabbajack.BuildServer.Test [Fact] public async Task CanValidateModLists() { - var modlists = await MakeModList("can_validate_file.txt"); + var modlists = await MakeModList("CanValidateModlistsFile.txt"); Consts.ModlistMetadataURL = modlists.ToString(); Utils.Log("Updating modlists"); await RevalidateLists(true); @@ -68,7 +68,7 @@ namespace Wabbajack.BuildServer.Test await CheckListFeeds(0, 1); Utils.Log("Break List"); - var archive = "can_validate_file.txt".RelativeTo(Fixture.ServerPublicFolder); + var archive = "CanValidateModlistsFile.txt".RelativeTo(Fixture.ServerPublicFolder); await archive.MoveToAsync(archive.WithExtension(new Extension(".moved")), true); // We can revalidate but the non-nexus archives won't be checked yet since the list didn't change diff --git a/Wabbajack.Server/Services/ListValidator.cs b/Wabbajack.Server/Services/ListValidator.cs index 75d61d2d..4ac633b2 100644 --- a/Wabbajack.Server/Services/ListValidator.cs +++ b/Wabbajack.Server/Services/ListValidator.cs @@ -139,14 +139,14 @@ namespace Wabbajack.Server.Services if (!(archive.State is IUpgradingState)) { - _logger.Log(LogLevel.Information, $"Cannot heal {archive.State} because it's not a healable state"); + _logger.Log(LogLevel.Information, $"Cannot heal {archive.State.PrimaryKeyString} because it's not a healable state"); return (archive, ArchiveStatus.InValid); } var srcDownload = await _sql.GetArchiveDownload(archive.State.PrimaryKeyString, archive.Hash, archive.Size); if (srcDownload == null || srcDownload.IsFailed == true) { - _logger.Log(LogLevel.Information, $"Cannot heal {archive.State} because it hasn't been previously successfully downloaded"); + _logger.Log(LogLevel.Information, $"Cannot heal {archive.State.PrimaryKeyString} because it hasn't been previously successfully downloaded"); return (archive, ArchiveStatus.InValid); }