diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-07-24 18:29:50 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 18:54:11 -0400 |
commit | e856d5efebe12b3aa65d5868ea7baa59cc54863d (patch) | |
tree | e678510fb04ab409d1ec91e6d54761c7357264ff /src/SMAPI.Web/Framework/ModRepositories/NexusRepository.cs | |
parent | 4fb16abfe9f300b0d841a98b462967b7ca1dcbe5 (diff) | |
download | SMAPI-e856d5efebe12b3aa65d5868ea7baa59cc54863d.tar.gz SMAPI-e856d5efebe12b3aa65d5868ea7baa59cc54863d.tar.bz2 SMAPI-e856d5efebe12b3aa65d5868ea7baa59cc54863d.zip |
add remote mod status to update check info (#651)
Diffstat (limited to 'src/SMAPI.Web/Framework/ModRepositories/NexusRepository.cs')
-rw-r--r-- | src/SMAPI.Web/Framework/ModRepositories/NexusRepository.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/SMAPI.Web/Framework/ModRepositories/NexusRepository.cs b/src/SMAPI.Web/Framework/ModRepositories/NexusRepository.cs index 4c5fe9bf..9679f93e 100644 --- a/src/SMAPI.Web/Framework/ModRepositories/NexusRepository.cs +++ b/src/SMAPI.Web/Framework/ModRepositories/NexusRepository.cs @@ -32,21 +32,21 @@ namespace StardewModdingAPI.Web.Framework.ModRepositories { // validate ID format if (!uint.TryParse(id, out uint nexusID)) - return new ModInfoModel($"The value '{id}' isn't a valid Nexus mod ID, must be an integer ID."); + return new ModInfoModel().WithError(RemoteModStatus.DoesNotExist, $"The value '{id}' isn't a valid Nexus mod ID, must be an integer ID."); // fetch info try { NexusMod mod = await this.Client.GetModAsync(nexusID); if (mod == null) - return new ModInfoModel("Found no mod with this ID."); + return new ModInfoModel().WithError(RemoteModStatus.DoesNotExist, "Found no Nexus mod with this ID."); if (mod.Error != null) - return new ModInfoModel(mod.Error); + return new ModInfoModel().WithError(RemoteModStatus.TemporaryError, mod.Error); return new ModInfoModel(name: mod.Name, version: this.NormaliseVersion(mod.Version), previewVersion: mod.LatestFileVersion?.ToString(), url: mod.Url); } catch (Exception ex) { - return new ModInfoModel(ex.ToString()); + return new ModInfoModel().WithError(RemoteModStatus.TemporaryError, ex.ToString()); } } |