107 references to Format
System.Text.Json (107)
System\Text\Json\Nodes\JsonArray.cs (1)
199
_ => throw new InvalidOperationException(SR.
Format
(SR.NodeElementWrongType, nameof(JsonValueKind.Array))),
System\Text\Json\Nodes\JsonNode.cs (1)
200
throw new InvalidOperationException(SR.
Format
(SR.NodeWrongType, nameof(JsonValue)));
System\Text\Json\Nodes\JsonObject.cs (1)
65
_ => throw new InvalidOperationException(SR.
Format
(SR.NodeElementWrongType, nameof(JsonValueKind.Object)))
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverter.cs (1)
15
public string ErrorMessage => _errorMessage ?? SR.
Format
(SR.SerializeTypeInstanceNotSupported, typeof(T).FullName);
System\Text\Json\ThrowHelper.cs (51)
66
throw new ArgumentOutOfRangeException(nameof(typeToConvert), SR.
Format
(SR.SerializerConverterFactoryInvalidArgument, typeToConvert.FullName));
100
return GetInvalidOperationException(SR.
Format
(SR.CallFlushToAvoidDataLoss, _buffered));
112
throw GetArgumentException(SR.
Format
(SR.PropertyNameTooLarge, tokenLength));
118
throw GetArgumentException(SR.
Format
(SR.ValueTooLarge, tokenLength));
136
throw GetArgumentException(SR.
Format
(SR.PropertyNameTooLarge, length));
144
ThrowArgumentException(SR.
Format
(SR.PropertyNameTooLarge, propertyName.Length));
149
ThrowArgumentException(SR.
Format
(SR.ValueTooLarge, value.Length));
158
ThrowArgumentException(SR.
Format
(SR.PropertyNameTooLarge, propertyName.Length));
163
ThrowArgumentException(SR.
Format
(SR.ValueTooLarge, value.Length));
172
ThrowArgumentException(SR.
Format
(SR.PropertyNameTooLarge, propertyName.Length));
177
ThrowArgumentException(SR.
Format
(SR.ValueTooLarge, value.Length));
186
ThrowArgumentException(SR.
Format
(SR.PropertyNameTooLarge, propertyName.Length));
191
ThrowArgumentException(SR.
Format
(SR.ValueTooLarge, value.Length));
206
ThrowArgumentException(SR.
Format
(SR.PropertyNameTooLarge, propertyName.Length));
240
return GetInvalidOperationException(SR.
Format
(SR.ZeroDepthAtEnd, currentDepth));
259
ThrowArgumentException(SR.
Format
(SR.PropertyNameTooLarge, propertyName.Length));
342
return GetInvalidOperationException(SR.
Format
(SR.InvalidComparison, tokenType));
405
message = SR.
Format
(SR.ArrayDepthTooLarge, json.CurrentState.Options.MaxDepth);
408
message = SR.
Format
(SR.MismatchedObjectArray, character);
420
message = SR.
Format
(SR.RequiredDigitNotFoundAfterSign, character);
423
message = SR.
Format
(SR.RequiredDigitNotFoundAfterDecimal, character);
429
message = SR.
Format
(SR.ExpectedEndAfterSingleJson, character);
432
message = SR.
Format
(SR.ExpectedEndOfDigitNotFound, character);
435
message = SR.
Format
(SR.ExpectedNextDigitEValueNotFound, character);
438
message = SR.
Format
(SR.ExpectedSeparatorAfterPropertyNameNotFound, character);
441
message = SR.
Format
(SR.ExpectedStartOfPropertyNotFound, character);
447
message = SR.
Format
(SR.ExpectedStartOfPropertyOrValueAfterComment, character);
450
message = SR.
Format
(SR.ExpectedStartOfValueNotFound, character);
456
message = SR.
Format
(SR.FoundInvalidCharacter, character);
459
message = SR.
Format
(SR.InvalidEndOfJsonNonPrimitive, json.TokenType);
462
message = SR.
Format
(SR.ObjectDepthTooLarge, json.CurrentState.Options.MaxDepth);
465
message = SR.
Format
(SR.ExpectedFalse, characters);
468
message = SR.
Format
(SR.ExpectedNull, characters);
471
message = SR.
Format
(SR.ExpectedTrue, characters);
474
message = SR.
Format
(SR.InvalidCharacterWithinString, character);
477
message = SR.
Format
(SR.InvalidCharacterAfterEscapeWithinString, character);
480
message = SR.
Format
(SR.InvalidHexCharacterWithinString, character);
498
message = SR.
Format
(SR.InvalidCharacterAtStartOfComment, character);
507
message = SR.
Format
(SR.InvalidLeadingZeroInNumber, character);
554
throw new ArgumentException(SR.
Format
(SR.CannotEncodeInvalidUTF8, builder));
560
throw new ArgumentException(SR.
Format
(SR.CannotEncodeInvalidUTF16, $"0x{charAsInt:X2}"));
566
throw GetInvalidOperationException(SR.
Format
(SR.CannotReadInvalidUTF16, $"0x{charAsInt:X2}"));
604
throw new OutOfMemoryException(SR.
Format
(SR.BufferMaximumSizeExceeded, capacity));
617
SR.
Format
(SR.CannotWriteEndAfterProperty, (char)token) :
618
SR.
Format
(SR.MismatchedObjectArray, (char)token);
624
message = SR.
Format
(SR.CannotStartObjectArrayWithoutProperty, tokenType);
627
message = SR.
Format
(SR.CannotStartObjectArrayAfterPrimitiveOrClose, tokenType);
630
message = SR.
Format
(SR.CannotWriteValueWithinObject, tokenType);
635
SR.
Format
(SR.CannotWritePropertyWithinArray, tokenType);
638
message = SR.
Format
(SR.CannotWriteValueAfterPrimitiveOrClose, tokenType);
728
message = SR.
Format
(SR.UnsupportedFormat, dataType);
System\Text\Json\ThrowHelper.Node.cs (3)
22
throw new ArgumentException(SR.
Format
(SR.NodeDuplicateKey, propertyName), paramName);
60
throw new InvalidOperationException(SR.
Format
(SR.NodeWrongType, concatenatedNames));
66
throw new InvalidOperationException(SR.
Format
(SR.NodeParentWrongType, typeName));
System\Text\Json\ThrowHelper.Serialization.cs (47)
34
throw new NotSupportedException(SR.
Format
(SR.SerializationNotSupportedType, propertyType));
40
throw new NotSupportedException(SR.
Format
(SR.TypeRequiresAsyncSerialization, propertyType));
52
throw new JsonException(SR.
Format
(SR.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true };
64
throw new InvalidOperationException(SR.
Format
(SR.DeserializeUnableToAssignNull, declaredType));
130
throw new JsonException(SR.
Format
(SR.SerializationConverterRead, converter)) { AppendPathInformation = true };
136
throw new JsonException(SR.
Format
(SR.SerializationConverterWrite, converter)) { AppendPathInformation = true };
142
throw new JsonException(SR.
Format
(SR.SerializerCycleDetected, maxDepth)) { AppendPathInformation = true };
157
throw new ArgumentException(SR.
Format
(SR.CannotSerializeInvalidType, typeToConvert), paramName);
170
throw new InvalidOperationException(SR.
Format
(SR.CannotSerializeInvalidType, typeToConvert));
216
throw new InvalidOperationException(SR.
Format
(SR.SerializationConverterOnAttributeInvalid, location));
341
throw new JsonException(SR.
Format
(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name)));
348
throw new JsonException(SR.
Format
(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name)));
369
throw new InvalidOperationException(SR.
Format
(SR.NamingPolicyReturnNull, namingPolicy));
375
throw new InvalidOperationException(SR.
Format
(SR.SerializerConverterFactoryReturnsNull, converterType));
381
throw new InvalidOperationException(SR.
Format
(SR.SerializerConverterFactoryReturnsJsonConverterFactory, converterType));
403
throw new InvalidOperationException(SR.
Format
(SR.ConstructorParamIncompleteBinding, parentType));
447
SR.
Format
(SR.ObjectWithParameterizedCtorRefMetadataNotSupported, jsonTypeInfo.Type));
454
throw new InvalidOperationException(SR.
Format
(SR.InvalidJsonTypeInfoOperationForKind, kind));
460
throw new InvalidOperationException(SR.
Format
(SR.OnDeserializingCallbacksNotSupported, type));
466
throw new InvalidOperationException(SR.
Format
(SR.CreateObjectConverterNotCompatible, type));
522
message = SR.
Format
(SR.DeserializeUnableToConvertValue, propertyType);
597
throw new InvalidOperationException(SR.
Format
(SR.PropertyTypeNotNullable, jsonPropertyInfo.PropertyType));
624
message += SR.
Format
(SR.SerializationNotSupportedParentType, propertyType);
652
message += SR.
Format
(SR.SerializationNotSupportedParentType, propertyType);
670
message = SR.
Format
(SR.DeserializationMustSpecifyTypeDiscriminator, type);
674
message = SR.
Format
(SR.CannotPopulateCollection, type);
678
message = SR.
Format
(SR.DeserializeInterfaceOrAbstractType, type);
692
ThrowNotSupportedException(ref state, reader, new NotSupportedException(SR.
Format
(SR.CannotPopulateCollection, type)));
698
ThrowJsonException(SR.
Format
(SR.MetadataInvalidTokenAfterValues, tokenType));
704
ThrowJsonException(SR.
Format
(SR.MetadataReferenceNotFound, id));
710
ThrowJsonException(SR.
Format
(SR.MetadataValueWasNotString, tokenType));
716
ThrowJsonException(SR.
Format
(SR.MetadataValueWasNotString, valueKind));
778
ThrowJsonException(SR.
Format
(SR.MetadataDuplicateIdFound, id));
784
ThrowJsonException(SR.
Format
(SR.DuplicateMetadataProperty, JsonHelpers.Utf8GetString(utf8PropertyName)));
790
ThrowJsonException(SR.
Format
(SR.MetadataInvalidReferenceToValueType, propertyType));
800
SR.
Format
(SR.MetadataInvalidPropertyInArrayMetadata, propertyNameAsString),
801
SR.
Format
(SR.DeserializeUnableToConvertValue, propertyType)));
812
SR.
Format
(SR.DeserializeUnableToConvertValue, propertyType)));
818
ThrowJsonException(SR.
Format
(SR.MetadataCannotParsePreservedObjectToImmutable, propertyType));
866
throw new NotSupportedException(SR.
Format
(SR.ConstructorContainsNullParameterNames, declaringType));
889
throw new MissingMemberException(SR.
Format
(SR.MissingFSharpCoreMember, missingFsharpCoreMember));
895
throw new NotSupportedException(SR.
Format
(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
901
throw new NotSupportedException(SR.
Format
(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
919
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_TypeDoesNotSupportPolymorphism, baseType));
955
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes, baseType));
967
ThrowJsonException(SR.
Format
(SR.Polymorphism_UnrecognizedTypeDiscriminator, typeDiscriminator));
985
throw new InvalidOperationException(SR.
Format
(SR.PipeWriter_DoesNotImplementUnflushedBytes, pipeWriter.GetType().Name));
System\Text\Json\Writer\JsonWriterHelper.cs (2)
234
SR.
Format
(SR.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(val)),
251
SR.
Format
(SR.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(utf8FormattedNumber[i])),