From d6b5e2ee242b70303b503756db68211a036bef2d Mon Sep 17 00:00:00 2001 From: manuc66 Date: Thu, 12 Apr 2018 22:51:07 +0200 Subject: [PATCH] fix typo found in #32 => replace return with throw --- JsonSubTypes.Tests/JsonSubTypesTests.cs | 2 +- JsonSubTypes/JsonSubtypes.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/JsonSubTypes.Tests/JsonSubTypesTests.cs b/JsonSubTypes.Tests/JsonSubTypesTests.cs index d65988a..c36c384 100644 --- a/JsonSubTypes.Tests/JsonSubTypesTests.cs +++ b/JsonSubTypes.Tests/JsonSubTypesTests.cs @@ -192,7 +192,7 @@ public void DeserializeNull() [Test] public void DeserializeBadDocument() { - Assert.Throws(() => JsonConvert.DeserializeObject("{\"Content\":8}")); + Assert.Throws(() => JsonConvert.DeserializeObject("{\"Content\":8}"), "Unrecognized token: Integer"); } [Test] diff --git a/JsonSubTypes/JsonSubtypes.cs b/JsonSubTypes/JsonSubtypes.cs index 7e248d0..36090d4 100644 --- a/JsonSubTypes/JsonSubtypes.cs +++ b/JsonSubTypes/JsonSubtypes.cs @@ -132,7 +132,7 @@ private object ReadJson(JsonReader reader, Type objectType, JsonSerializer seria linePosition = lineInfo.LinePosition; } - return new JsonReaderException(string.Format("Unrecognized token: {0}", + throw new JsonReaderException(string.Format("Unrecognized token: {0}", reader.TokenType), reader.Path, lineNumber, linePosition, null); }