105 references to Format
System.Text.Json (105)
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)
198
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 (45)
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));
329
throw new InvalidOperationException(SR.
Format
(SR.NamingPolicyReturnNull, namingPolicy));
335
throw new InvalidOperationException(SR.
Format
(SR.SerializerConverterFactoryReturnsNull, converterType));
341
throw new InvalidOperationException(SR.
Format
(SR.SerializerConverterFactoryReturnsJsonConverterFactory, converterType));
363
throw new InvalidOperationException(SR.
Format
(SR.ConstructorParamIncompleteBinding, parentType));
407
SR.
Format
(SR.ObjectWithParameterizedCtorRefMetadataNotSupported, jsonTypeInfo.Type));
414
throw new InvalidOperationException(SR.
Format
(SR.InvalidJsonTypeInfoOperationForKind, kind));
420
throw new InvalidOperationException(SR.
Format
(SR.OnDeserializingCallbacksNotSupported, type));
426
throw new InvalidOperationException(SR.
Format
(SR.CreateObjectConverterNotCompatible, type));
482
message = SR.
Format
(SR.DeserializeUnableToConvertValue, propertyType);
557
throw new InvalidOperationException(SR.
Format
(SR.PropertyTypeNotNullable, jsonPropertyInfo.PropertyType));
584
message += SR.
Format
(SR.SerializationNotSupportedParentType, propertyType);
612
message += SR.
Format
(SR.SerializationNotSupportedParentType, propertyType);
630
message = SR.
Format
(SR.DeserializationMustSpecifyTypeDiscriminator, type);
634
message = SR.
Format
(SR.CannotPopulateCollection, type);
638
message = SR.
Format
(SR.DeserializeInterfaceOrAbstractType, type);
652
ThrowNotSupportedException(ref state, reader, new NotSupportedException(SR.
Format
(SR.CannotPopulateCollection, type)));
658
ThrowJsonException(SR.
Format
(SR.MetadataInvalidTokenAfterValues, tokenType));
664
ThrowJsonException(SR.
Format
(SR.MetadataReferenceNotFound, id));
670
ThrowJsonException(SR.
Format
(SR.MetadataValueWasNotString, tokenType));
676
ThrowJsonException(SR.
Format
(SR.MetadataValueWasNotString, valueKind));
738
ThrowJsonException(SR.
Format
(SR.MetadataDuplicateIdFound, id));
744
ThrowJsonException(SR.
Format
(SR.DuplicateMetadataProperty, JsonHelpers.Utf8GetString(utf8PropertyName)));
750
ThrowJsonException(SR.
Format
(SR.MetadataInvalidReferenceToValueType, propertyType));
760
SR.
Format
(SR.MetadataInvalidPropertyInArrayMetadata, propertyNameAsString),
761
SR.
Format
(SR.DeserializeUnableToConvertValue, propertyType)));
772
SR.
Format
(SR.DeserializeUnableToConvertValue, propertyType)));
778
ThrowJsonException(SR.
Format
(SR.MetadataCannotParsePreservedObjectToImmutable, propertyType));
826
throw new NotSupportedException(SR.
Format
(SR.ConstructorContainsNullParameterNames, declaringType));
849
throw new MissingMemberException(SR.
Format
(SR.MissingFSharpCoreMember, missingFsharpCoreMember));
855
throw new NotSupportedException(SR.
Format
(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
861
throw new NotSupportedException(SR.
Format
(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
879
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_TypeDoesNotSupportPolymorphism, baseType));
915
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes, baseType));
927
ThrowJsonException(SR.
Format
(SR.Polymorphism_UnrecognizedTypeDiscriminator, typeDiscriminator));
945
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])),