From f870e652d4d6dbb0a9d63a0fd69ef0354f4fb0c0 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Mon, 13 May 2019 21:45:57 -0500 Subject: [PATCH] Obsoleted ModsaberModInfo (finally) Added option to turn off long exception stack traces where the messages tell you most of the info you need --- IPA.Loader/Config/SelfConfig.cs | 1 + .../PluginInterfaces/BeatSaber/ModsaberModInfo.cs | 1 + IPA.Loader/Updating/BeatMods/Updater.cs | 15 ++++++++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index 3f116c11..24575ab7 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -51,6 +51,7 @@ namespace IPA.Config { public bool ShowCallSource = false; public bool ShowDebug = false; + public bool ShowHandledErrorStackTraces = false; public bool HideMessagesForPerformance = true; public int HideLogThreshold = 512; } diff --git a/IPA.Loader/PluginInterfaces/BeatSaber/ModsaberModInfo.cs b/IPA.Loader/PluginInterfaces/BeatSaber/ModsaberModInfo.cs index fdd3eca7..e0a7de05 100644 --- a/IPA.Loader/PluginInterfaces/BeatSaber/ModsaberModInfo.cs +++ b/IPA.Loader/PluginInterfaces/BeatSaber/ModsaberModInfo.cs @@ -9,6 +9,7 @@ namespace IPA /// A class to provide information about a mod on ModSaber.ML /// // ReSharper disable once IdentifierTypo + [Obsolete("This is unused, and has been since the manifest was introduced. All functionality is provided by the manifest.")] public class ModsaberModInfo { /// diff --git a/IPA.Loader/Updating/BeatMods/Updater.cs b/IPA.Loader/Updating/BeatMods/Updater.cs index 6cdbf8aa..8592e919 100644 --- a/IPA.Loader/Updating/BeatMods/Updater.cs +++ b/IPA.Loader/Updating/BeatMods/Updater.cs @@ -290,7 +290,8 @@ namespace IPA.Updating.BeatMods catch (Exception e) { Logger.updater.Error($"Error getting info for {dep.Name}"); - Logger.updater.Error(e); + if (SelfConfig.SelfConfigRef.Value.Debug.ShowHandledErrorStackTraces) + Logger.updater.Error(e); dep.MetaRequestFailed = true; continue; } @@ -356,7 +357,8 @@ namespace IPA.Updating.BeatMods catch (Exception e) { Logger.updater.Error($"Error getting mod list for {dep.Name}"); - Logger.updater.Error(e); + if (SelfConfig.SelfConfigRef.Value.Debug.ShowHandledErrorStackTraces) + Logger.updater.Error(e); dep.MetaRequestFailed = true; continue; } @@ -440,7 +442,8 @@ namespace IPA.Updating.BeatMods catch (Exception e) { Logger.updater.Error($"Error occurred while trying to get information for {item}"); - Logger.updater.Error(e); + if (SelfConfig.SelfConfigRef.Value.Debug.ShowHandledErrorStackTraces) + Logger.updater.Error(e); yield break; } @@ -509,9 +512,11 @@ namespace IPA.Updating.BeatMods { // any exception is an intercept exception Logger.updater.Error($"BeatMods did not return expected data for {item.Name}"); } + else + Logger.updater.Error($"Error downloading mod {item.Name}"); - Logger.updater.Error($"Error downloading mod {item.Name}"); - Logger.updater.Error(downloadTask.Exception); + if (SelfConfig.SelfConfigRef.Value.Debug.ShowHandledErrorStackTraces) + Logger.updater.Error(downloadTask.Exception); installFail?.Invoke(item, downloadTask.Exception); continue;