530 references to ThrowHelper
System.Text.Json (530)
System\ReflectionExtensions.cs (1)
90ThrowHelper.ThrowInvalidOperationException_SerializationDuplicateAttribute(typeof(TAttribute), memberInfo);
System\Text\Json\Document\JsonDocument.cs (2)
1103ThrowHelper.ThrowObjectDisposedException_JsonDocument(); 1111ThrowHelper.ThrowJsonElementWrongTypeException(expected, actual);
System\Text\Json\Document\JsonDocument.Parse.cs (3)
449ThrowHelper.ThrowJsonReaderException( 475ThrowHelper.ThrowJsonReaderException( 597ThrowHelper.ThrowJsonReaderException(
System\Text\Json\Document\JsonDocumentOptions.cs (1)
56ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value));
System\Text\Json\Document\JsonElement.cs (15)
358throw ThrowHelper.GetJsonElementWrongTypeException(nameof(Boolean), actualType.ToValueKind()); 428ThrowHelper.ThrowFormatException(); 673ThrowHelper.ThrowFormatException(); 725ThrowHelper.ThrowFormatException(); 775ThrowHelper.ThrowFormatException(); 827ThrowHelper.ThrowFormatException(); 894ThrowHelper.ThrowFormatException(); 961ThrowHelper.ThrowFormatException(); 1013ThrowHelper.ThrowFormatException(); 1064ThrowHelper.ThrowFormatException(); 1115ThrowHelper.ThrowFormatException(); 1166ThrowHelper.ThrowFormatException(); 1261ThrowHelper.ThrowInsufficientExecutionStackException_JsonElementDeepEqualsInsufficientExecutionStack(); 1581ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType.StartArray, tokenType); 1607ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType.StartObject, tokenType);
System\Text\Json\JsonHelpers.cs (2)
297ThrowHelper.ThrowOutOfMemoryException(length); 476ThrowHelper.ThrowArgumentOutOfRangeException_JsonNumberExponentTooLarge(nameof(exponent));
System\Text\Json\Nodes\JsonArray.IList.cs (3)
158ThrowHelper.ThrowArgumentOutOfRangeException_NeedNonNegNum(nameof(index)); 163ThrowHelper.ThrowArgumentOutOfRangeException_NeedNonNegNum(nameof(count)); 170ThrowHelper.ThrowArgumentException_InvalidOffLen();
System\Text\Json\Nodes\JsonNode.cs (9)
67ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray)); 88ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonObject)); 109ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonValue)); 218ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray), nameof(JsonObject)); 223ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray), nameof(JsonObject)); 275ThrowHelper.ThrowInvalidOperationException_NodeParentWrongType(nameof(JsonObject)); 293ThrowHelper.ThrowInvalidOperationException_NodeParentWrongType(nameof(JsonArray)); 348ThrowHelper.ThrowInvalidOperationException_NodeAlreadyHasParent(); 356ThrowHelper.ThrowInvalidOperationException_NodeCycleDetected();
System\Text\Json\Nodes\JsonValue.cs (3)
59ThrowHelper.ThrowArgumentException_NodeValueNotAllowed(nameof(value)); 93ThrowHelper.ThrowArgumentException_NodeValueNotAllowed(nameof(value)); 187ThrowHelper.ThrowInvalidOperationException_NodeElementCannotBeObjectOrArray();
System\Text\Json\Nodes\JsonValueOfElement.cs (1)
44ThrowHelper.ThrowInvalidOperationException_NodeUnableToConvertElement(Value.ValueKind, typeof(TypeToConvert));
System\Text\Json\Nodes\JsonValueOfT.cs (1)
34ThrowHelper.ThrowInvalidOperationException_NodeUnableToConvert(typeof(TValue), typeof(T));
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (8)
280throw ThrowHelper.GetInvalidOperationException_ReadInvalidUTF8(ex); 312throw ThrowHelper.GetInvalidOperationException_ReadInvalidUTF8(dfe); 327throw ThrowHelper.GetInvalidOperationException_ReadInvalidUTF8(); 387throw ThrowHelper.GetArgumentException_ReadInvalidUTF16(ex); 420throw ThrowHelper.GetArgumentException_ReadInvalidUTF16(ex); 544ThrowHelper.ThrowInvalidOperationException_ReadInvalidUTF16(scalar); 552ThrowHelper.ThrowInvalidOperationException_ReadIncompleteUTF16(); 565ThrowHelper.ThrowInvalidOperationException_ReadInvalidUTF16(lowSurrogate);
System\Text\Json\Reader\JsonReaderOptions.cs (2)
35ThrowHelper.ThrowArgumentOutOfRangeException_CommentEnumMustBeInRange(nameof(value)); 58ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value));
System\Text\Json\Reader\Utf8JsonReader.cs (62)
286ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedJsonTokens); 315ThrowHelper.ThrowInvalidOperationException_CannotSkipOnPartial(); 457ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(TokenType); 528ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(TokenType); 742ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ObjectDepthTooLarge); 756ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.MismatchedObjectArray, JsonConstants.CloseBrace); 762ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd); 776ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ArrayDepthTooLarge); 790ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.MismatchedObjectArray, JsonConstants.CloseBracket); 796ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd); 865ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 925ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ZeroDepthAtEnd); 935ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidEndOfJsonNonPrimitive); 953ThrowHelper.ThrowJsonReaderException(ref this, resource); 1098ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidEndOfJsonNonPrimitive); 1125ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, marker); 1202ThrowHelper.ThrowJsonReaderException(ref this, resource, bytes: span); 1223ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndOfDigitNotFound, _buffer[_consumed - 1]); 1270ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedSeparatorAfterPropertyNameNotFound, first); 1315ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 1356ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterAfterEscapeWithinString, currentByte); 1379ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterWithinString, currentByte); 1389ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 1412ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidHexCharacterWithinString, nextByte); 1477ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndOfDigitNotFound, nextByte); 1501ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedNextDigitEValueNotFound, nextByte); 1530ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndOfDigitNotFound, data[i]); 1550ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1559ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundAfterSign, nextByte); 1596ThrowHelper.ThrowJsonReaderException(ref this, 1644ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1652ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundAfterDecimal, nextByte); 1666ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1680ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1690ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundAfterSign, nextByte); 1752ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndAfterSingleJson, marker); 1766ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 1803ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd); 1805ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 1818ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd); 1833ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.FoundInvalidCharacter, marker); 1879ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndAfterSingleJson, first); 1891ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueAfterComment, first); 1903ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 1947ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd); 1950ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 1970ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd); 2007ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 2049ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 2174ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, marker); 2222ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndAfterSingleJson, marker); 2235ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 2271ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd); 2274ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, marker); 2287ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd); 2303ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.FoundInvalidCharacter, marker); 2332ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash); 2338ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash); 2443ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfLineSeparator); 2457ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfCommentNotFound); 2509ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterAtStartOfComment, marker); 2515ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment);
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (70)
172ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 233ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ZeroDepthAtEnd); 243ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidEndOfJsonNonPrimitive); 284ThrowHelper.ThrowJsonReaderException(ref this, resource); 290ThrowHelper.ThrowJsonReaderException(ref this, resource); 465ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidEndOfJsonNonPrimitive); 471ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidEndOfJsonNonPrimitive); 502ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, marker); 668return ThrowHelper.GetJsonReaderException(ref this, resource, nextByte: default, bytes: span); 688ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndOfDigitNotFound, _buffer[_consumed - 1]); 735ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedSeparatorAfterPropertyNameNotFound, first); 781ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 803ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 855ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterAfterEscapeWithinString, currentByte); 873ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidHexCharacterWithinString, nextByte); 890ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 909ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterWithinString, currentByte); 920ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 992ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterAfterEscapeWithinString, currentByte); 1010ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidHexCharacterWithinString, nextByte); 1027ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 1051ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterWithinString, currentByte); 1062ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfStringNotFound); 1173ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndOfDigitNotFound, nextByte); 1199ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedNextDigitEValueNotFound, nextByte); 1232ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndOfDigitNotFound, data[i]); 1264ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1271ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1286ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundAfterSign, nextByte); 1340ThrowHelper.ThrowJsonReaderException(ref this, 1433ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1440ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1453ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundAfterDecimal, nextByte); 1467ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1475ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1495ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1503ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundEndOfData); 1518ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.RequiredDigitNotFoundAfterSign, nextByte); 1584ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndAfterSingleJson, marker); 1598ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 1606ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 1644ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd); 1646ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 1659ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd); 1674ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.FoundInvalidCharacter, marker); 1720ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndAfterSingleJson, first); 1732ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueAfterComment, first); 1744ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 1752ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 1797ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd); 1800ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 1820ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd); 1857ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 1901ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, first); 2026ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, marker); 2078ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndAfterSingleJson, marker); 2091ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 2099ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound); 2136ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd); 2139ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, marker); 2152ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd); 2167ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.FoundInvalidCharacter, marker); 2242ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment); 2249ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment); 2262ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.InvalidCharacterAtStartOfComment, marker); 2279ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment); 2293ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment); 2496ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfLineSeparator); 2578ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment); 2585ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.UnexpectedEndOfDataWhileReadingComment);
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (52)
36ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 73ThrowHelper.ThrowInvalidOperationException_ExpectedString(_tokenType); 91ThrowHelper.ThrowArgumentException_DestinationTooShort(); 137ThrowHelper.ThrowInvalidOperationException_ExpectedString(_tokenType); 243ThrowHelper.ThrowInvalidOperationException_ExpectedComment(TokenType); 267ThrowHelper.ThrowInvalidOperationException_ExpectedBoolean(TokenType); 290ThrowHelper.ThrowFormatException(DataType.Base64String); 314ThrowHelper.ThrowFormatException(NumericType.Byte); 324ThrowHelper.ThrowFormatException(NumericType.Byte); 349ThrowHelper.ThrowFormatException(NumericType.SByte); 359ThrowHelper.ThrowFormatException(NumericType.SByte); 383ThrowHelper.ThrowFormatException(NumericType.Int16); 393ThrowHelper.ThrowFormatException(NumericType.Int16); 417ThrowHelper.ThrowFormatException(NumericType.Int32); 427ThrowHelper.ThrowFormatException(NumericType.Int32); 451ThrowHelper.ThrowFormatException(NumericType.Int64); 461ThrowHelper.ThrowFormatException(NumericType.Int64); 486ThrowHelper.ThrowFormatException(NumericType.UInt16); 496ThrowHelper.ThrowFormatException(NumericType.UInt16); 521ThrowHelper.ThrowFormatException(NumericType.UInt32); 531ThrowHelper.ThrowFormatException(NumericType.UInt32); 556ThrowHelper.ThrowFormatException(NumericType.UInt64); 566ThrowHelper.ThrowFormatException(NumericType.UInt64); 589ThrowHelper.ThrowFormatException(NumericType.Single); 610ThrowHelper.ThrowFormatException(NumericType.Single); 622ThrowHelper.ThrowFormatException(NumericType.Single); 646ThrowHelper.ThrowFormatException(NumericType.Double); 667ThrowHelper.ThrowFormatException(NumericType.Double); 679ThrowHelper.ThrowFormatException(NumericType.Double); 703ThrowHelper.ThrowFormatException(NumericType.Decimal); 713ThrowHelper.ThrowFormatException(NumericType.Decimal); 735ThrowHelper.ThrowFormatException(DataType.DateTime); 745ThrowHelper.ThrowFormatException(DataType.DateTime); 768ThrowHelper.ThrowFormatException(DataType.DateTimeOffset); 778ThrowHelper.ThrowFormatException(DataType.DateTimeOffset); 801ThrowHelper.ThrowFormatException(DataType.Guid); 811ThrowHelper.ThrowFormatException(DataType.Guid); 831ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 859ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 895ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 930ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 965ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1000ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1036ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1072ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1108ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1143ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1173ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1203ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1238ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 1303ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 1369ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType);
System\Text\Json\Schema\JsonSchemaExporter.cs (2)
377ThrowHelper.ThrowNotSupportedException_JsonSchemaExporterDoesNotSupportReferenceHandlerPreserve(); 411ThrowHelper.ThrowInvalidOperationException_JsonSchemaExporterDepthTooLarge();
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableOfTConverter.cs (2)
19ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state); 40ThrowHelper.ThrowNotSupportedException_TypeRequiresAsyncSerialization(Type);
System\Text\Json\Serialization\Converters\Collection\ICollectionOfTConverter.cs (1)
36ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\IDictionaryConverter.cs (1)
38ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\IDictionaryOfTKeyTValueConverter.cs (1)
38ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverter.cs (1)
30ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactoryHelpers.cs (2)
40ThrowHelper.ThrowNotSupportedException_SerializationNotSupported(type); 64ThrowHelper.ThrowNotSupportedException_SerializationNotSupported(type);
System\Text\Json\Serialization\Converters\Collection\IEnumerableOfTConverter.cs (1)
28ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\IListConverter.cs (1)
35ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\IListOfTConverter.cs (1)
36ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\IReadOnlyDictionaryOfTKeyTValueConverter.cs (1)
26ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
33ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (5)
37ThrowHelper.ThrowNotSupportedException_DeserializeNoConstructor(typeInfo, ref reader, ref state); 77ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 132ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 139ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 276ThrowHelper.ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ref state, typeToConvert, reader);
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (4)
52ThrowHelper.ThrowNotSupportedException_DeserializeNoConstructor(typeInfo, ref reader, ref state); 89ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 159ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 263ThrowHelper.ThrowUnexpectedMetadataException(propertyName, ref reader, ref state);
System\Text\Json\Serialization\Converters\Collection\ListOfTConverter.cs (1)
30ThrowHelper.ThrowNotSupportedException_SerializationNotSupported(state.Current.JsonTypeInfo.Type);
System\Text\Json\Serialization\Converters\Collection\QueueOfTConverter.cs (1)
28ThrowHelper.ThrowNotSupportedException_SerializationNotSupported(state.Current.JsonTypeInfo.Type);
System\Text\Json\Serialization\Converters\Collection\StackOfTConverter.cs (1)
29ThrowHelper.ThrowNotSupportedException_SerializationNotSupported(state.Current.JsonTypeInfo.Type);
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverter.cs (1)
35ThrowHelper.ThrowNotSupportedException_CannotPopulateCollection(Type, ref reader, ref state);
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
33throw ThrowHelper.GetInvalidOperationException_ExpectedArray(reader.TokenType);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (1)
58throw ThrowHelper.GetInvalidOperationException_ExpectedObject(reader.TokenType);
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (4)
22ThrowHelper.ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type, this); 28ThrowHelper.ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type, this); 56ThrowHelper.ThrowNotSupportedException_DictionaryKeyTypeNotSupported(runtimeType, this); 80ThrowHelper.ThrowNotSupportedException_NoMetadataForType(typeToConvert, _originatingResolver);
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (1)
49ThrowHelper.ThrowInvalidOperationException_SerializationDuplicateTypeAttribute<JsonConstructorAttribute>(typeToConvert);
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (4)
32ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 43ThrowHelper.ThrowNotSupportedException_DeserializeNoConstructor(jsonTypeInfo, ref reader, ref state); 62ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 119ThrowHelper.ThrowNotSupportedException_DeserializeNoConstructor(jsonTypeInfo, ref reader, ref state);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (3)
45ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 125ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 581ThrowHelper.ThrowInvalidOperationException_ConstructorParameterIncompleteBinding(Type);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (1)
27ThrowHelper.ThrowJsonException_ConstructorParameterDisallowNull(jsonParameterInfo.Name, state.Current.JsonTypeInfo.Type);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Small.cs (1)
80ThrowHelper.ThrowJsonException_ConstructorParameterDisallowNull(info.Name, state.Current.JsonTypeInfo.Type);
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
30ThrowHelper.ThrowFormatException(DataType.Boolean);
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (3)
17ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 22ThrowHelper.ThrowInvalidOperationException_ExpectedChar(reader.TokenType); 30ThrowHelper.ThrowInvalidOperationException_ExpectedChar(reader.TokenType);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
19ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 35ThrowHelper.ThrowFormatException(DataType.DateOnly); 52ThrowHelper.ThrowFormatException(DataType.DateOnly);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (4)
128ThrowHelper.ThrowJsonException(); 168ThrowHelper.ThrowJsonException(); 188ThrowHelper.ThrowJsonException(); 573ThrowHelper.ThrowInvalidOperationException_UnsupportedEnumIdentifier(typeof(T), name);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (3)
25ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.TokenType); 58ThrowHelper.ThrowFormatException(NumericType.Half); 102ThrowHelper.ThrowFormatException(NumericType.Half);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (2)
25ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.TokenType); 48ThrowHelper.ThrowFormatException(NumericType.Int128);
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (1)
27ThrowHelper.ThrowInvalidOperationException_ExpectedPropertyName(reader.TokenType);
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
46ThrowHelper.ThrowInvalidOperationException_NamingPolicyReturnNull(options.DictionaryKeyPolicy);
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (4)
21ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 39ThrowHelper.ThrowFormatException(DataType.TimeOnly); 60ThrowHelper.ThrowFormatException(DataType.TimeOnly); 72ThrowHelper.ThrowFormatException(DataType.TimeOnly);
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (4)
21ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 39ThrowHelper.ThrowFormatException(DataType.TimeSpan); 59ThrowHelper.ThrowFormatException(DataType.TimeSpan); 71ThrowHelper.ThrowFormatException(DataType.TimeSpan);
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (2)
25ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.TokenType); 48ThrowHelper.ThrowFormatException(NumericType.UInt128);
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
40ThrowHelper.ThrowJsonException();
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (4)
29ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 42ThrowHelper.ThrowFormatException(DataType.Version); 55ThrowHelper.ThrowFormatException(DataType.Version); 77ThrowHelper.ThrowJsonException();
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (2)
38ThrowHelper.ThrowNotSupportedException_DerivedConverterDoesNotSupportMetadata(resolvedType.Type); 104ThrowHelper.ThrowNotSupportedException_DerivedConverterDoesNotSupportMetadata(derivedJsonTypeInfo.Type);
System\Text\Json\Serialization\JsonConverterFactory.cs (2)
43ThrowHelper.ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(GetType()); 46ThrowHelper.ThrowInvalidOperationException_SerializerConverterFactoryReturnsJsonConverterFactorty(GetType());
System\Text\Json\Serialization\JsonConverterOfT.cs (15)
155ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type); 260ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 331ThrowHelper.ThrowJsonException_SerializerCycleDetected(options.EffectiveMaxDepth); 467ThrowHelper.ThrowJsonException_SerializerCycleDetected(options.EffectiveMaxDepth); 508ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 512ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 520ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 524ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 539ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 548ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 562ThrowHelper.ThrowJsonException_SerializationConverterWrite(this); 597ThrowHelper.ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type, this); 611ThrowHelper.ThrowJsonException_SerializationConverterRead(this); 630ThrowHelper.ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type, this); 653ThrowHelper.ThrowJsonException_SerializationConverterWrite(this);
System\Text\Json\Serialization\JsonConverterOfT.ReadCore.cs (7)
63ThrowHelper.ReThrowWithPath(ref state, jsonReaderEx); 66case FormatException when ex.Source == ThrowHelper.ExceptionSourceValueToRethrowAsJsonException: 67ThrowHelper.ReThrowWithPath(ref state, reader, ex); 70case InvalidOperationException when ex.Source == ThrowHelper.ExceptionSourceValueToRethrowAsJsonException: 71ThrowHelper.ReThrowWithPath(ref state, reader, ex); 79ThrowHelper.AddJsonExceptionInformation(ref state, reader, jsonEx); 85ThrowHelper.ThrowNotSupportedException(ref state, reader, ex);
System\Text\Json\Serialization\JsonConverterOfT.WriteCore.cs (4)
29case InvalidOperationException when ex.Source == ThrowHelper.ExceptionSourceValueToRethrowAsJsonException: 30ThrowHelper.ReThrowWithPath(ref state, ex); 38ThrowHelper.AddJsonExceptionInformation(ref state, jsonException); 44ThrowHelper.ThrowNotSupportedException(ref state, ex);
System\Text\Json\Serialization\JsonNumberEnumConverter.cs (1)
33ThrowHelper.ThrowArgumentOutOfRangeException_JsonConverterFactory_TypeNotSupported(typeToConvert);
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (5)
61ThrowHelper.ThrowInvalidOperationException_NoMetadataForType(inputType, context); 77ThrowHelper.ThrowArgumentException_DeserializeWrongType(inputType, value); 122ThrowHelper.ThrowInvalidOperationException_DeserializeUnableToAssignNull(declaredType: typeof(T)); 126ThrowHelper.ThrowInvalidCastException_DeserializeUnableToAssignValue(typeOfValue: value.GetType(), declaredType: typeof(T)); 137ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(typeof(T));
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (35)
79ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(reader.GetUnescapedSpan(), ref state); 91ThrowHelper.ThrowJsonException_MetadataUnexpectedProperty(propertyName, ref state); 96ThrowHelper.ThrowJsonException_MetadataIdCannotBeCombinedWithRef(propertyName, ref state); 101ThrowHelper.ThrowJsonException_MetadataCannotParsePreservedObjectIntoImmutable(converter.Type!); 112ThrowHelper.ThrowJsonException_MetadataUnexpectedProperty(propertyName, ref state); 117ThrowHelper.ThrowJsonException_MetadataInvalidReferenceToValueType(converter.Type!); 122ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(reader.GetUnescapedSpan(), ref state); 133ThrowHelper.ThrowJsonException_MetadataUnexpectedProperty(propertyName, ref state); 138ThrowHelper.ThrowJsonException_DuplicateMetadataProperty(state.Current.JsonPropertyName); 149ThrowHelper.ThrowJsonException_DuplicateMetadataProperty(s_valuesPropertyName); 155ThrowHelper.ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ref state, jsonTypeInfo.Type, reader); 176ThrowHelper.ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ref state, jsonTypeInfo.Type, reader); 182ThrowHelper.ThrowUnexpectedMetadataException(propertyName, ref reader, ref state); 216ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.TokenType); 221ThrowHelper.ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotSupported(s_refPropertyName, ref reader, ref state); 230ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.TokenType); 235ThrowHelper.ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotSupported(s_refPropertyName, ref reader, ref state); 253ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.TokenType); 263ThrowHelper.ThrowJsonException_MetadataValuesInvalidToken(reader.TokenType); 301ThrowHelper.ThrowJsonException_MetadataStandaloneValuesProperty(ref state, s_valuesPropertyName); 367ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); 373ThrowHelper.ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotSupported(s_refPropertyName, ref reader, ref state); 378ThrowHelper.ThrowJsonException_MetadataValueWasNotString(property.Value.ValueKind); 390ThrowHelper.ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotSupported(s_refPropertyName, ref reader, ref state); 396ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); 401ThrowHelper.ThrowJsonException_MetadataValueWasNotString(property.Value.ValueKind); 431ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); 437ThrowHelper.ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotSupported(s_refPropertyName, ref reader, ref state); 449ThrowHelper.ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotSupported(s_refPropertyName, ref reader, ref state); 455ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); 474ThrowHelper.ThrowJsonException_MetadataValueWasNotString(metadataValueKind); 488ThrowHelper.ThrowJsonException_MetadataUnexpectedProperty(s_valuesPropertyName, ref state); 504ThrowHelper.ThrowJsonException_MetadataPreservedArrayValuesNotFound(ref state, converter.Type!); 511ThrowHelper.ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ref state, converter.Type!, reader); 531ThrowHelper.ThrowInvalidOperationException_MetadataReferenceOfTypeCannotBeAssignedToType(
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (4)
48ThrowHelper.ThrowJsonException_UnmappedJsonProperty(jsonTypeInfo.Type, stringPropertyName); 97ThrowHelper.ThrowUnexpectedMetadataException(propertyName, ref reader, ref state); 137ThrowHelper.ThrowInvalidOperationException_NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty(); 141ThrowHelper.ThrowNotSupportedException_SerializationNotSupported(jsonPropertyInfo.PropertyType);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (6)
276ThrowHelper.ThrowArgumentException_SerializerDoesNotSupportComments(nameof(reader)); 301ThrowHelper.ThrowArgumentException_SerializerDoesNotSupportComments(nameof(reader)); 342ThrowHelper.ThrowJsonReaderException(ref reader, ExceptionResource.ExpectedOneCompleteToken); 357ThrowHelper.ThrowJsonReaderException(ref reader, ExceptionResource.NotEnoughData); 439ThrowHelper.ThrowJsonReaderException( 450ThrowHelper.ReThrowWithPath(ref state, ex);
System\Text\Json\Serialization\JsonSerializerContext.cs (1)
114ThrowHelper.ThrowInvalidOperationException_ResolverTypeInfoOptionsNotCompatible();
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (4)
61ThrowHelper.ThrowArgumentException_CannotSerializeInvalidType(nameof(type), type, null, null); 86ThrowHelper.ThrowArgumentException_CannotSerializeInvalidType(nameof(type), type, null, null); 126ThrowHelper.ThrowNotSupportedException_NoMetadataForType(type, TypeInfoResolver); 343NotSupportedException nse = ThrowHelper.GetNotSupportedException_AmbiguousMetadataForType(type, candidateType, interfaceType);
System\Text\Json\Serialization\JsonSerializerOptions.Converters.cs (1)
107ThrowHelper.ThrowInvalidOperationException_ConverterCanConvertMultipleTypes(propertyType, converter);
System\Text\Json\Serialization\JsonSerializerOptions.cs (7)
571ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); 878ThrowHelper.ThrowInvalidOperationException_JsonSerializerOptionsNoTypeInfoResolverSpecified(); 961ThrowHelper.ThrowInvalidOperationException_JsonSerializerIsReflectionDisabled(); 995ThrowHelper.ThrowInvalidOperationException_ResolverTypeNotCompatible(type, info.Type); 1000ThrowHelper.ThrowInvalidOperationException_ResolverTypeInfoOptionsNotCompatible(); 1067ThrowHelper.ThrowInvalidOperationException_SerializerOptionsReadOnly(_typeInfoResolver as JsonSerializerContext); 1109ThrowHelper.ThrowInvalidOperationException_InvalidChainedResolver();
System\Text\Json\Serialization\JsonStringEnumConverter.cs (2)
57ThrowHelper.ThrowArgumentOutOfRangeException_JsonConverterFactory_TypeNotSupported(typeToConvert); 116ThrowHelper.ThrowArgumentOutOfRangeException_JsonConverterFactory_TypeNotSupported(typeToConvert);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (4)
166ThrowHelper.ThrowInvalidOperationException_SerializationConverterNotCompatible(converter.GetType(), typeToConvert); 187ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(declaringType, memberInfo, typeToConvert); 195ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(declaringType, memberInfo); 216ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(declaringType, memberInfo, typeToConvert);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.cs (1)
110ThrowHelper.ThrowInvalidOperationException_DefaultTypeInfoResolverImmutable();
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (3)
238ThrowHelper.ThrowInvalidOperationException_CannotSerializeInvalidType(typeToConvert, memberInfo.DeclaringType, memberInfo); 301ThrowHelper.ThrowNotSupportedException_ConstructorContainsNullParameterNames(typeInfo.Converter.ConstructorInfo.DeclaringType); 395ThrowHelper.ThrowInvalidOperationException_SerializerPropertyNameNull(propertyInfo);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (1)
237ThrowHelper.ThrowMissingMemberException_MissingFSharpCoreMember(memberName);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (2)
152ThrowHelper.ThrowInvalidOperationException_JsonIncludeOnInaccessibleProperty(jsonPropertyInfo.MemberName, jsonPropertyInfo.DeclaringType); 225ThrowHelper.ThrowInvalidOperationException_SerializerPropertyNameNull(propertyInfo);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (16)
255ThrowHelper.ThrowInvalidOperationException_PropertyTypeNotNullable(this); 294ThrowHelper.ThrowInvalidOperationException_PropertyTypeNotNullable(this); 326ThrowHelper.ThrowInvalidOperationException_SerializationDataExtensionPropertyInvalid(this); 455ThrowHelper.ThrowInvalidOperationException_JsonPropertyRequiredAndNotDeserializable(this); 460ThrowHelper.ThrowInvalidOperationException_JsonPropertyRequiredAndExtensionData(this); 487ThrowHelper.ThrowInvalidOperationException_PropertyConflictsWithMetadataPropertyName(DeclaringType, Name); 572ThrowHelper.ThrowInvalidOperationException_NumberHandlingOnPropertyInvalid(this); 614ThrowHelper.ThrowInvalidOperationException_NumberHandlingOnPropertyInvalid(this); 649ThrowHelper.ThrowInvalidOperationException_ObjectCreationHandlingPopulateNotSupportedByConverter(this); 654ThrowHelper.ThrowInvalidOperationException_ObjectCreationHandlingPropertyMustHaveAGetter(this); 659ThrowHelper.ThrowInvalidOperationException_ObjectCreationHandlingPropertyValueTypeMustHaveASetter(this); 666ThrowHelper.ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization(this); 671ThrowHelper.ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowReadOnlyMember(this); 681ThrowHelper.ThrowNotSupportedException_ObjectCreationHandlingPropertyDoesNotSupportParameterizedConstructors(); 686ThrowHelper.ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowReferenceHandling(); 929ThrowHelper.ThrowInvalidOperationException_JsonPropertyInfoIsBoundToDifferentJsonTypeInfo(this);
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (9)
214ThrowHelper.ThrowJsonException_PropertyGetterDisallowNull(Name, state.Current.JsonTypeInfo.Type); 229ThrowHelper.ThrowJsonException_SerializationConverterWrite(EffectiveConverter); 288ThrowHelper.ThrowInvalidOperationException_DeserializeUnableToAssignNull(EffectiveConverter.Type); 291ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(EffectiveConverter.Type); 298ThrowHelper.ThrowJsonException_PropertySetterDisallowNull(Name, state.Current.JsonTypeInfo.Type); 321ThrowHelper.ThrowJsonException_PropertySetterDisallowNull(Name, state.Current.JsonTypeInfo.Type); 350ThrowHelper.ThrowJsonException_PropertySetterDisallowNull(Name, state.Current.JsonTypeInfo.Type); 373ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(EffectiveConverter.Type); 423ThrowHelper.ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(MemberName!, DeclaringType);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (22)
128ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 158ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 188ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 194ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOnDeserializingCallbacksNotSupported(Type); 224ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 315ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 320ThrowHelper.ThrowArgumentException_JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo(nameof(value)); 376ThrowHelper.ThrowInvalidOperationException_NoMetadataForTypeProperties(Options.TypeInfoResolver, Type); 543ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 587ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 674ThrowHelper.ThrowInvalidOperationException_TypeInfoImmutable(); 942ThrowHelper.ThrowArgumentException_CannotSerializeInvalidType(nameof(type), type, null, null); 991ThrowHelper.ThrowArgumentException_CannotSerializeInvalidType(nameof(propertyType), propertyType, Type, name); 1087ThrowHelper.ThrowInvalidOperationException_ExtensionDataConflictsWithUnmappedMemberHandling(Type, property); 1092ThrowHelper.ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(Type, typeof(JsonExtensionDataAttribute)); 1112ThrowHelper.ThrowInvalidOperationException_SerializerPropertyNameConflict(Type, property.Name); 1200ThrowHelper.ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters( 1213ThrowHelper.ThrowInvalidOperationException_ExtensionDataCannotBindToCtorParam(ExtensionDataProperty.MemberName, ExtensionDataProperty); 1224ThrowHelper.ThrowInvalidOperationException_CannotSerializeInvalidType(type, declaringType: null, memberInfo: null); 1344ThrowHelper.ThrowNotSupportedException_SerializationNotSupported(type); 1371ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(_jsonTypeInfo.Kind); 1427ThrowHelper.ThrowInvalidOperationException_SerializerPropertyNameConflict(_jsonTypeInfo.Type, jsonPropertyInfo.Name);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (2)
68ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 75ThrowHelper.ThrowInvalidOperationException_CreateObjectConverterNotCompatible(Type);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (3)
123ThrowHelper.ThrowOperationCanceledException_PipeWriteCanceled(); 156ThrowHelper.ThrowInvalidOperationException_PipeWriterDoesNotImplementUnflushedBytes(pipeWriter); 187ThrowHelper.ThrowOperationCanceledException_PipeWriteCanceled();
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverChain.cs (1)
11=> ThrowHelper.ThrowInvalidOperationException_TypeInfoResolverChainImmutable();
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (11)
31ThrowHelper.ThrowInvalidOperationException_TypeDoesNotSupportPolymorphism(BaseType); 42ThrowHelper.ThrowInvalidOperationException_DerivedTypeNotSupported(BaseType, derivedType); 50ThrowHelper.ThrowInvalidOperationException_DerivedTypeIsAlreadySpecified(BaseType, derivedType); 57ThrowHelper.ThrowInvalidOperationException_TypeDicriminatorIdIsAlreadySpecified(BaseType, typeDiscriminator); 68ThrowHelper.ThrowInvalidOperationException_PolymorphicTypeConfigurationDoesNotSpecifyDerivedTypes(BaseType); 77ThrowHelper.ThrowNotSupportedException_BaseConverterDoesNotSupportMetadata(BaseType); 88ThrowHelper.ThrowInvalidOperationException_InvalidCustomTypeDiscriminatorPropertyName(); 104ThrowHelper.ThrowInvalidOperationException_PropertyConflictsWithMetadataPropertyName(derivedTypeInfo.JsonTypeInfo.Type, propertyName); 143ThrowHelper.ThrowNotSupportedException_RuntimeTypeNotSupported(BaseType, runtimeType); 178ThrowHelper.ThrowJsonException_UnrecognizedTypeDiscriminator(typeDiscriminator); 239ThrowHelper.ThrowNotSupportedException_RuntimeTypeDiamondAmbiguity(BaseType, type, result.JsonTypeInfo.Type, interfaceResult.JsonTypeInfo.Type);
System\Text\Json\Serialization\PreserveReferenceResolver.cs (2)
37ThrowHelper.ThrowJsonException_MetadataDuplicateIdFound(referenceId); 66ThrowHelper.ThrowJsonException_MetadataReferenceNotFound(referenceId);
System\Text\Json\Serialization\ReadStackFrame.cs (1)
160ThrowHelper.ThrowJsonException_JsonRequiredPropertyMissing(typeInfo, RequiredPropertiesSet);
System\Text\Json\Writer\JsonWriterHelper.cs (18)
43ThrowHelper.ThrowArgumentNullException(nameof(value)); 46ThrowHelper.ThrowArgumentOutOfRangeException_NewLine(nameof(value)); 53ThrowHelper.ThrowArgumentOutOfRangeException_IndentCharacter(nameof(value)); 60ThrowHelper.ThrowArgumentOutOfRangeException_IndentSize(nameof(value), JsonConstants.MinimumIndentSize, JsonConstants.MaximumIndentSize); 67ThrowHelper.ThrowArgumentException_PropertyNameTooLarge(propertyName.Length); 74ThrowHelper.ThrowArgumentException_ValueTooLarge(value.Length); 82ThrowHelper.ThrowArgumentException_ValueNotSupported(); 91ThrowHelper.ThrowArgumentException_ValueNotSupported(); 99ThrowHelper.ThrowArgumentException_PropertyNameTooLarge(propertyName.Length); 106ThrowHelper.ThrowArgumentException_ValueTooLarge(value.Length); 113ThrowHelper.ThrowArgumentException(propertyName, value); 120ThrowHelper.ThrowArgumentException(propertyName, value); 127ThrowHelper.ThrowArgumentException(propertyName, value); 134ThrowHelper.ThrowArgumentException(propertyName, value); 141ThrowHelper.ThrowPropertyNameTooLargeArgumentException(propertyName.Length); 148ThrowHelper.ThrowPropertyNameTooLargeArgumentException(propertyName.Length); 234SR.Format(SR.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(val)), 251SR.Format(SR.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(utf8FormattedNumber[i])),
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (2)
98ThrowHelper.ThrowArgumentException_InvalidUTF8(value.Slice(encoderBytesWritten)); 216ThrowHelper.ThrowArgumentException_InvalidUTF16(value[encoderCharsWritten]);
System\Text\Json\Writer\JsonWriterOptions.cs (1)
106ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value));
System\Text\Json\Writer\Utf8JsonWriter.cs (6)
386ThrowHelper.ThrowObjectDisposedException_Utf8JsonWriter(); 1196ThrowHelper.ThrowInvalidOperationException_NeedLargerSpan(); 1221ThrowHelper.ThrowInvalidOperationException_NeedLargerSpan(); 1234=> ThrowHelper.ThrowInvalidOperationException(resource, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); 1239=> ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, maxDepth: _options.MaxDepth, token, _tokenType); 1244=> ThrowHelper.ThrowInvalidOperationException(ExceptionResource.DepthTooLarge, _currentDepth, _options.MaxDepth, token: default, tokenType: default);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (3)
18ThrowHelper.ThrowInvalidOperationOrArgumentException(propertyName, _currentDepth, _options.MaxDepth); 25ThrowHelper.ThrowInvalidOperationOrArgumentException(utf8PropertyName, _currentDepth, _options.MaxDepth); 32ThrowHelper.ThrowInvalidOperationException(_currentDepth, _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (2)
58ThrowHelper.ThrowArgumentException_ValueTooLarge(bytes.Length); 101ThrowHelper.ThrowArgumentException_ValueTooLarge(bytes.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (5)
49ThrowHelper.ThrowArgumentException_InvalidCommentValue(); 100ThrowHelper.ThrowArgumentException_InvalidUTF16(value[written]); 141ThrowHelper.ThrowArgumentException_InvalidUTF16(value[written]); 166ThrowHelper.ThrowArgumentException_InvalidCommentValue(); 171ThrowHelper.ThrowArgumentException_InvalidUTF8(utf8Value);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (1)
98ThrowHelper.ThrowInvalidOperationException_CannotMixEncodings(_enclosingContainer, currentSegmentEncoding);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (5)
107ThrowHelper.ThrowArgumentException_ValueTooLarge(int.MaxValue); 145ThrowHelper.ThrowArgumentException(SR.ExpectedJsonTokens); 149ThrowHelper.ThrowArgumentException_ValueTooLarge(utf8JsonLen); 197ThrowHelper.ThrowArgumentException_ValueTooLarge(json.Length); 234ThrowHelper.ThrowArgumentException(SR.ExpectedJsonTokens);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (1)
363ThrowHelper.ThrowArgumentException_ValueTooLarge(value.Length);