summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-03-15 21:26:03 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-03-15 21:26:03 -0400
commitff6df97ae8ca12f45aaba1776472f1dc10234b91 (patch)
tree9a05387ae7b140ed7ed4ea038253ace773da9318
parent90cdbdf7b29ddeee80b213957a02e0e5c691282e (diff)
downloadSMAPI-ff6df97ae8ca12f45aaba1776472f1dc10234b91.tar.gz
SMAPI-ff6df97ae8ca12f45aaba1776472f1dc10234b91.tar.bz2
SMAPI-ff6df97ae8ca12f45aaba1776472f1dc10234b91.zip
fix error handling in update check API (#457)
-rw-r--r--src/SMAPI.Web/Controllers/ModsApiController.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI.Web/Controllers/ModsApiController.cs b/src/SMAPI.Web/Controllers/ModsApiController.cs
index abae7db7..c99c87fb 100644
--- a/src/SMAPI.Web/Controllers/ModsApiController.cs
+++ b/src/SMAPI.Web/Controllers/ModsApiController.cs
@@ -115,9 +115,9 @@ namespace StardewModdingAPI.Web.Controllers
if (info.Error == null)
{
if (info.Version == null)
- info = new ModInfoModel(info.Name, info.Version, info.Url, "Mod has no version number.");
+ info = new ModInfoModel(name: info.Name, version: info.Version, url: info.Url, error: "Mod has no version number.");
if (!allowInvalidVersions && !Regex.IsMatch(info.Version, this.VersionRegex, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase))
- info = new ModInfoModel(info.Name, info.Version, info.Url, $"Mod has invalid semantic version '{info.Version}'.");
+ info = new ModInfoModel(name: info.Name, version: info.Version, url: info.Url, error: $"Mod has invalid semantic version '{info.Version}'.");
}
// cache & return