Log invalid meta location

This commit is contained in:
erri120 2020-07-06 08:58:13 +02:00
parent a3c8fb4c17
commit 9a71620061
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
4 changed files with 13 additions and 3 deletions

View File

@ -190,7 +190,7 @@ namespace Wabbajack.Common
/// </summary>
public static GameMetaData GetByFuzzyName(string someName)
{
return TryGetByFuzzyName(someName) ?? throw new ArgumentNullException($"{someName} could not be translated to a game");
return TryGetByFuzzyName(someName) ?? throw new ArgumentNullException(nameof(someName), $"\"{someName}\" could not be translated to a game!");
}
/// <summary>

View File

@ -68,7 +68,8 @@ namespace Wabbajack.Lib.Downloaders
public static async Task<AbstractDownloadState> ResolveArchive(dynamic ini, bool quickMode = false)
{
var states = await Task.WhenAll(Downloaders.Select(d => (Task<AbstractDownloadState>)d.GetDownloaderState(ini, quickMode)));
var states = await Task.WhenAll(Downloaders.Select(d =>
(Task<AbstractDownloadState>)d.GetDownloaderState(ini, quickMode)));
return states.FirstOrDefault(result => result != null);
}

View File

@ -58,6 +58,7 @@ namespace Wabbajack.Lib.Downloaders
if (general.modID != null && general.fileID != null && general.gameName != null)
{
var game = GameRegistry.GetByFuzzyName((string)general.gameName).Game;
if (quickMode)
{
return new State

View File

@ -397,7 +397,15 @@ namespace Wabbajack.Lib
{
var metaname = filename.WithExtension(Consts.MetaFileExtension);
if (!metaname.Exists) return true;
return await DownloadDispatcher.ResolveArchive(metaname.LoadIniFile()) == null;
try
{
return await DownloadDispatcher.ResolveArchive(metaname.LoadIniFile()) == null;
}
catch (Exception e)
{
Utils.ErrorThrow(e, $"Exception while checking meta {filename}");
return false;
}
}
var to_find = (await MO2DownloadsFolder.EnumerateFiles()