From 36a527956c5410fe5992bfc42fdc11adff9cd9db Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 3 Mar 2018 17:54:17 -0500 Subject: fix detected incompatibility errors not showing mod's update URL (#453) --- src/SMAPI/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index acab8c70..fec03d6f 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -388,7 +388,7 @@ namespace StardewModdingAPI mods = resolver.ProcessDependencies(mods, modDatabase).ToArray(); // load mods - this.LoadMods(mods, this.JsonHelper, this.ContentManager); + this.LoadMods(mods, this.JsonHelper, this.ContentManager, modDatabase); // check for updates this.CheckForUpdatesAsync(mods); @@ -670,7 +670,8 @@ namespace StardewModdingAPI /// The mods to load. /// The JSON helper with which to read mods' JSON files. /// The content manager to use for mod content. - private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, SContentManager contentManager) + /// Handles access to SMAPI's internal mod metadata list. + private void LoadMods(IModMetadata[] mods, JsonHelper jsonHelper, SContentManager contentManager, ModDatabase modDatabase) { this.Monitor.Log("Loading mods...", LogLevel.Trace); @@ -744,9 +745,10 @@ namespace StardewModdingAPI { modAssembly = modAssemblyLoader.Load(metadata, assemblyPath, assumeCompatible: metadata.DataRecord?.Status == ModStatus.AssumeCompatible); } - catch (IncompatibleInstructionException ex) + catch (IncompatibleInstructionException) // details already in trace logs { - TrackSkip(metadata, "it's no longer compatible. Please check for a newer version of the mod."); + string url = modDatabase.GetModPageUrlFor(metadata.Manifest.UniqueID); + TrackSkip(metadata, $"it's no longer compatible. Please check for a newer version of the mod{(url != null ? $" at {url}" : "")}."); continue; } catch (SAssemblyLoadFailedException ex) -- cgit