diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-08-06 01:16:55 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 19:05:59 -0400 |
commit | d88d3505ec75c3633cdd5d57058a5d290e558dfb (patch) | |
tree | 2dcab084db69b491998b51efa43d7a6b3fc65090 /src/SMAPI.Web/Controllers/JsonValidatorController.cs | |
parent | e51638948f4355c27d6b3f02d637d4ed754ccb73 (diff) | |
download | SMAPI-d88d3505ec75c3633cdd5d57058a5d290e558dfb.tar.gz SMAPI-d88d3505ec75c3633cdd5d57058a5d290e558dfb.tar.bz2 SMAPI-d88d3505ec75c3633cdd5d57058a5d290e558dfb.zip |
add error type code to HTML for convenience when adding custom error messages (#654)
Diffstat (limited to 'src/SMAPI.Web/Controllers/JsonValidatorController.cs')
-rw-r--r-- | src/SMAPI.Web/Controllers/JsonValidatorController.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI.Web/Controllers/JsonValidatorController.cs b/src/SMAPI.Web/Controllers/JsonValidatorController.cs index cc2a7add..c23103dd 100644 --- a/src/SMAPI.Web/Controllers/JsonValidatorController.cs +++ b/src/SMAPI.Web/Controllers/JsonValidatorController.cs @@ -99,7 +99,7 @@ namespace StardewModdingAPI.Web.Controllers } catch (JsonReaderException ex) { - return this.View("Index", result.AddErrors(new JsonValidatorErrorModel(ex.LineNumber, ex.Path, ex.Message))); + return this.View("Index", result.AddErrors(new JsonValidatorErrorModel(ex.LineNumber, ex.Path, ex.Message, ErrorType.None))); } // format JSON @@ -124,7 +124,7 @@ namespace StardewModdingAPI.Web.Controllers // validate JSON parsed.IsValid(schema, out IList<ValidationError> rawErrors); var errors = rawErrors - .Select(error => new JsonValidatorErrorModel(error.LineNumber, error.Path, this.GetFlattenedError(error))) + .Select(error => new JsonValidatorErrorModel(error.LineNumber, error.Path, this.GetFlattenedError(error), error.ErrorType)) .ToArray(); return this.View("Index", result.AddErrors(errors)); } |