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/ChucklefishRepository.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/ChucklefishRepository.cs')
-rw-r--r-- | src/SMAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/SMAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs b/src/SMAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs index 87e29a2f..04c80dd2 100644 --- a/src/SMAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs +++ b/src/SMAPI.Web/Framework/ModRepositories/ChucklefishRepository.cs @@ -32,21 +32,21 @@ namespace StardewModdingAPI.Web.Framework.ModRepositories { // validate ID format if (!uint.TryParse(id, out uint realID)) - return new ModInfoModel($"The value '{id}' isn't a valid Chucklefish mod ID, must be an integer ID."); + return new ModInfoModel().WithError(RemoteModStatus.DoesNotExist, $"The value '{id}' isn't a valid Chucklefish mod ID, must be an integer ID."); // fetch info try { var mod = await this.Client.GetModAsync(realID); if (mod == null) - return new ModInfoModel("Found no mod with this ID."); + return new ModInfoModel().WithError(RemoteModStatus.DoesNotExist, "Found no Chucklefish mod with this ID."); // create model return new ModInfoModel(name: mod.Name, version: this.NormaliseVersion(mod.Version), url: mod.Url); } catch (Exception ex) { - return new ModInfoModel(ex.ToString()); + return new ModInfoModel().WithError(RemoteModStatus.TemporaryError, ex.ToString()); } } |