Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ThrowHelper.cs
Go to the documentation of this file.
7
8namespace System.Text.Json;
9
10internal static class ThrowHelper
11{
12 [MethodImpl(MethodImplOptions.NoInlining)]
18
23
24 [MethodImpl(MethodImplOptions.NoInlining)]
26 {
27 return new ArgumentOutOfRangeException(parameterName, message);
28 }
29
34
35 [MethodImpl(MethodImplOptions.NoInlining)]
36 private static ArgumentException GetArgumentException(string message)
37 {
38 return new ArgumentException(message);
39 }
40
42 public static void ThrowArgumentException(string message)
43 {
44 throw GetArgumentException(message);
45 }
46
52
58
64
70
83
96
109
122
136
143
145 public static void ThrowInvalidOperationException(string message)
146 {
147 throw GetInvalidOperationException(message);
148 }
149
150 [MethodImpl(MethodImplOptions.NoInlining)]
152 {
154 ex.Source = "System.Text.Json.Rethrowable";
155 return ex;
156 }
157
171
176
181
186
188 {
189 return GetInvalidOperationException("boolean", tokenType);
190 }
191
196
201
203 {
204 return GetInvalidOperationException("comment", tokenType);
205 }
206
207 [MethodImpl(MethodImplOptions.NoInlining)]
212
213 [MethodImpl(MethodImplOptions.NoInlining)]
215 {
216 return GetInvalidOperationException(System.SR.Format(System.SR.InvalidCast, tokenType, message));
217 }
218
219 [MethodImpl(MethodImplOptions.NoInlining)]
224
225 [MethodImpl(MethodImplOptions.NoInlining)]
230
231 [MethodImpl(MethodImplOptions.NoInlining)]
236
237 [MethodImpl(MethodImplOptions.NoInlining)]
242
243 [MethodImpl(MethodImplOptions.NoInlining)]
248
254
255 [MethodImpl(MethodImplOptions.NoInlining)]
257 {
259 long lineNumber = json.CurrentState._lineNumber;
260 long bytePositionInLine = json.CurrentState._bytePositionInLine;
261 resourceString += $" LineNumber: {lineNumber} | BytePositionInLine: {bytePositionInLine}.";
263 }
264
265 private static bool IsPrintable(byte value)
266 {
267 if (value >= 32)
268 {
269 return value < 127;
270 }
271 return false;
272 }
273
274 [MethodImpl(MethodImplOptions.AggressiveInlining)]
275 internal static string GetPrintableString(byte value)
276 {
277 if (!IsPrintable(value))
278 {
279 return $"0x{value:X2}";
280 }
281 char c = (char)value;
282 return c.ToString();
283 }
284
285 [MethodImpl(MethodImplOptions.NoInlining)]
286 private static string GetResourceString(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, string characters)
287 {
289 string result = "";
290 switch (resource)
291 {
292 case ExceptionResource.ArrayDepthTooLarge:
293 result = System.SR.Format(System.SR.ArrayDepthTooLarge, json.CurrentState.Options.MaxDepth);
294 break;
295 case ExceptionResource.MismatchedObjectArray:
297 break;
298 case ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd:
300 break;
301 case ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd:
303 break;
304 case ExceptionResource.EndOfStringNotFound:
306 break;
307 case ExceptionResource.RequiredDigitNotFoundAfterSign:
309 break;
310 case ExceptionResource.RequiredDigitNotFoundAfterDecimal:
312 break;
313 case ExceptionResource.RequiredDigitNotFoundEndOfData:
315 break;
316 case ExceptionResource.ExpectedEndAfterSingleJson:
318 break;
319 case ExceptionResource.ExpectedEndOfDigitNotFound:
321 break;
322 case ExceptionResource.ExpectedNextDigitEValueNotFound:
324 break;
325 case ExceptionResource.ExpectedSeparatorAfterPropertyNameNotFound:
327 break;
328 case ExceptionResource.ExpectedStartOfPropertyNotFound:
330 break;
331 case ExceptionResource.ExpectedStartOfPropertyOrValueNotFound:
333 break;
334 case ExceptionResource.ExpectedStartOfPropertyOrValueAfterComment:
336 break;
337 case ExceptionResource.ExpectedStartOfValueNotFound:
339 break;
340 case ExceptionResource.ExpectedValueAfterPropertyNameNotFound:
342 break;
343 case ExceptionResource.FoundInvalidCharacter:
345 break;
346 case ExceptionResource.InvalidEndOfJsonNonPrimitive:
348 break;
349 case ExceptionResource.ObjectDepthTooLarge:
350 result = System.SR.Format(System.SR.ObjectDepthTooLarge, json.CurrentState.Options.MaxDepth);
351 break;
352 case ExceptionResource.ExpectedFalse:
353 result = System.SR.Format(System.SR.ExpectedFalse, characters);
354 break;
355 case ExceptionResource.ExpectedNull:
356 result = System.SR.Format(System.SR.ExpectedNull, characters);
357 break;
358 case ExceptionResource.ExpectedTrue:
359 result = System.SR.Format(System.SR.ExpectedTrue, characters);
360 break;
361 case ExceptionResource.InvalidCharacterWithinString:
363 break;
364 case ExceptionResource.InvalidCharacterAfterEscapeWithinString:
366 break;
367 case ExceptionResource.InvalidHexCharacterWithinString:
369 break;
370 case ExceptionResource.EndOfCommentNotFound:
372 break;
373 case ExceptionResource.ZeroDepthAtEnd:
375 break;
376 case ExceptionResource.ExpectedJsonTokens:
378 break;
379 case ExceptionResource.NotEnoughData:
380 result = System.SR.NotEnoughData;
381 break;
382 case ExceptionResource.ExpectedOneCompleteToken:
384 break;
385 case ExceptionResource.InvalidCharacterAtStartOfComment:
387 break;
388 case ExceptionResource.UnexpectedEndOfDataWhileReadingComment:
390 break;
391 case ExceptionResource.UnexpectedEndOfLineSeparator:
393 break;
394 case ExceptionResource.InvalidLeadingZeroInNumber:
396 break;
397 }
398 return result;
399 }
400
403 {
404 throw GetInvalidOperationException(resource, currentDepth, token, tokenType);
405 }
406
412
415 {
417 int num = Math.Min(value.Length, 10);
418 for (int i = 0; i < num; i++)
419 {
420 byte value2 = value[i];
421 if (IsPrintable(value2))
422 {
423 stringBuilder.Append((char)value2);
424 continue;
425 }
428 handler.AppendLiteral("0x");
429 handler.AppendFormatted(value2, "X2");
430 stringBuilder2.Append(ref handler);
431 }
432 if (num < value.Length)
433 {
434 stringBuilder.Append("...");
435 }
437 }
438
441 {
442 throw new ArgumentException(System.SR.Format(System.SR.CannotEncodeInvalidUTF16, $"0x{charAsInt:X2}"));
443 }
444
450
456
461
466
468 {
470 ex.Source = "System.Text.Json.Rethrowable";
471 return ex;
472 }
473
474 [MethodImpl(MethodImplOptions.NoInlining)]
482
488
489 [MethodImpl(MethodImplOptions.NoInlining)]
490 private static string GetResourceString(ExceptionResource resource, int currentDepth, byte token, JsonTokenType tokenType)
491 {
492 string result = "";
493 switch (resource)
494 {
495 case ExceptionResource.MismatchedObjectArray:
496 result = ((tokenType == JsonTokenType.PropertyName) ? System.SR.Format(System.SR.CannotWriteEndAfterProperty, (char)token) : System.SR.Format(System.SR.MismatchedObjectArray, (char)token));
497 break;
498 case ExceptionResource.DepthTooLarge:
500 break;
501 case ExceptionResource.CannotStartObjectArrayWithoutProperty:
503 break;
504 case ExceptionResource.CannotStartObjectArrayAfterPrimitiveOrClose:
506 break;
507 case ExceptionResource.CannotWriteValueWithinObject:
509 break;
510 case ExceptionResource.CannotWritePropertyWithinArray:
512 break;
513 case ExceptionResource.CannotWriteValueAfterPrimitiveOrClose:
515 break;
516 }
517 return result;
518 }
519
521 {
523 ex.Source = "System.Text.Json.Rethrowable";
524 return ex;
525 }
526
527 [MethodImpl(MethodImplOptions.NoInlining)]
529 {
530 string message = "";
531 switch (numericType)
532 {
533 case NumericType.Byte:
534 message = System.SR.FormatByte;
535 break;
536 case NumericType.SByte:
537 message = System.SR.FormatSByte;
538 break;
539 case NumericType.Int16:
540 message = System.SR.FormatInt16;
541 break;
542 case NumericType.Int32:
543 message = System.SR.FormatInt32;
544 break;
545 case NumericType.Int64:
546 message = System.SR.FormatInt64;
547 break;
548 case NumericType.UInt16:
549 message = System.SR.FormatUInt16;
550 break;
551 case NumericType.UInt32:
552 message = System.SR.FormatUInt32;
553 break;
554 case NumericType.UInt64:
555 message = System.SR.FormatUInt64;
556 break;
557 case NumericType.Single:
558 message = System.SR.FormatSingle;
559 break;
560 case NumericType.Double:
561 message = System.SR.FormatDouble;
562 break;
563 case NumericType.Decimal:
564 message = System.SR.FormatDecimal;
565 break;
566 }
567 FormatException ex = new FormatException(message);
568 ex.Source = "System.Text.Json.Rethrowable";
569 return ex;
570 }
571
572 [MethodImpl(MethodImplOptions.NoInlining)]
574 {
575 string message = "";
576 switch (dateType)
577 {
578 case DataType.Boolean:
579 message = System.SR.FormatBoolean;
580 break;
581 case DataType.DateTime:
582 message = System.SR.FormatDateTime;
583 break;
584 case DataType.DateTimeOffset:
586 break;
587 case DataType.TimeSpan:
588 message = System.SR.FormatTimeSpan;
589 break;
590 case DataType.Base64String:
592 break;
593 case DataType.Guid:
594 message = System.SR.FormatGuid;
595 break;
596 }
597 FormatException ex = new FormatException(message);
598 ex.Source = "System.Text.Json.Rethrowable";
599 return ex;
600 }
601
606
607 [MethodImpl(MethodImplOptions.NoInlining)]
613
614 [MethodImpl(MethodImplOptions.NoInlining)]
620
621 [MethodImpl(MethodImplOptions.NoInlining)]
627
628 [MethodImpl(MethodImplOptions.NoInlining)]
634
635 [MethodImpl(MethodImplOptions.NoInlining)]
641
642 [MethodImpl(MethodImplOptions.NoInlining)]
648
649 [MethodImpl(MethodImplOptions.NoInlining)]
655
660
661 [MethodImpl(MethodImplOptions.NoInlining)]
667
668 [MethodImpl(MethodImplOptions.NoInlining)]
674
675 [MethodImpl(MethodImplOptions.NoInlining)]
681
682 [MethodImpl(MethodImplOptions.NoInlining)]
688
689 [MethodImpl(MethodImplOptions.NoInlining)]
695
696 [MethodImpl(MethodImplOptions.NoInlining)]
699 {
701 {
702 AppendPathInformation = true
703 };
704 }
705
706 [MethodImpl(MethodImplOptions.NoInlining)]
712
713 [MethodImpl(MethodImplOptions.NoInlining)]
719
720 [MethodImpl(MethodImplOptions.NoInlining)]
723 {
725 {
726 AppendPathInformation = true
727 };
728 }
729
730 [MethodImpl(MethodImplOptions.NoInlining)]
733 {
735 {
736 AppendPathInformation = true
737 };
738 }
739
740 [MethodImpl(MethodImplOptions.NoInlining)]
743 {
745 {
746 AppendPathInformation = true
747 };
748 }
749
750 [MethodImpl(MethodImplOptions.NoInlining)]
752 public static void ThrowJsonException(string message = null)
753 {
754 throw new JsonException(message)
755 {
756 AppendPathInformation = true
757 };
758 }
759
760 [MethodImpl(MethodImplOptions.NoInlining)]
770
771 [MethodImpl(MethodImplOptions.NoInlining)]
777
778 [MethodImpl(MethodImplOptions.NoInlining)]
789
790 [MethodImpl(MethodImplOptions.NoInlining)]
801
802 [MethodImpl(MethodImplOptions.NoInlining)]
809
810 [MethodImpl(MethodImplOptions.NoInlining)]
816
817 [MethodImpl(MethodImplOptions.NoInlining)]
823
824 [MethodImpl(MethodImplOptions.NoInlining)]
830
836
842
843 [MethodImpl(MethodImplOptions.NoInlining)]
849
850 [MethodImpl(MethodImplOptions.NoInlining)]
856
857 [MethodImpl(MethodImplOptions.NoInlining)]
863
864 [MethodImpl(MethodImplOptions.NoInlining)]
870
871 [MethodImpl(MethodImplOptions.NoInlining)]
877
878 [MethodImpl(MethodImplOptions.NoInlining)]
885
886 [MethodImpl(MethodImplOptions.NoInlining)]
892
893 [MethodImpl(MethodImplOptions.NoInlining)]
901
902 [MethodImpl(MethodImplOptions.NoInlining)]
905 {
906 string text = state.JsonPath();
907 string message = ex.Message;
908 int num = message.AsSpan().LastIndexOf(" LineNumber: ");
909 message = ((num < 0) ? (message + " Path: " + text + ".") : $"{message.Substring(0, num)} Path: {text} |{message.Substring(num)}");
910 throw new JsonException(message, text, ex.LineNumber, ex.BytePositionInLine, ex);
911 }
912
913 [MethodImpl(MethodImplOptions.NoInlining)]
916 {
917 JsonException ex2 = new JsonException(null, ex);
919 throw ex2;
920 }
921
923 {
924 long lineNumber = reader.CurrentState._lineNumber;
925 ex.LineNumber = lineNumber;
926 long bytePositionInLine = reader.CurrentState._bytePositionInLine;
928 string value = (ex.Path = state.JsonPath());
929 string text2 = ex._message;
930 if (string.IsNullOrEmpty(text2))
931 {
932 Type type = state.Current.JsonPropertyInfo?.RuntimePropertyType;
933 if (type == null)
934 {
935 type = state.Current.JsonTypeInfo?.Type;
936 }
939 }
940 if (ex.AppendPathInformation)
941 {
942 text2 += $" Path: {value} | LineNumber: {lineNumber} | BytePositionInLine: {bytePositionInLine}.";
943 ex.SetMessage(text2);
944 }
945 }
946
947 [MethodImpl(MethodImplOptions.NoInlining)]
950 {
951 JsonException ex2 = new JsonException(null, ex);
953 throw ex2;
954 }
955
957 {
958 string text2 = (ex.Path = state.PropertyPath());
959 string text3 = ex._message;
960 if (string.IsNullOrEmpty(text3))
961 {
964 }
965 if (ex.AppendPathInformation)
966 {
967 text3 = text3 + " Path: " + text2 + ".";
968 ex.SetMessage(text3);
969 }
970 }
971
972 [MethodImpl(MethodImplOptions.NoInlining)]
983
984 [MethodImpl(MethodImplOptions.NoInlining)]
990
991 [MethodImpl(MethodImplOptions.NoInlining)]
997
998 [MethodImpl(MethodImplOptions.NoInlining)]
1004
1007 {
1008 string text = ex.Message;
1009 Type type = state.Current.JsonPropertyInfo?.RuntimePropertyType;
1010 if (type == null)
1011 {
1012 type = state.Current.JsonTypeInfo.Type;
1013 }
1014 if (!text.Contains(type.ToString()))
1015 {
1016 if (text.Length > 0)
1017 {
1018 text += " ";
1019 }
1021 }
1022 long lineNumber = reader.CurrentState._lineNumber;
1023 long bytePositionInLine = reader.CurrentState._bytePositionInLine;
1024 text += $" Path: {state.JsonPath()} | LineNumber: {lineNumber} | BytePositionInLine: {bytePositionInLine}.";
1025 throw new NotSupportedException(text, ex);
1026 }
1027
1030 {
1031 string text = ex.Message;
1032 Type type = state.Current.DeclaredJsonPropertyInfo?.RuntimePropertyType;
1033 if (type == null)
1034 {
1035 type = state.Current.JsonTypeInfo.Type;
1036 }
1037 if (!text.Contains(type.ToString()))
1038 {
1039 if (text.Length > 0)
1040 {
1041 text += " ";
1042 }
1044 }
1045 text = text + " Path: " + state.PropertyPath() + ".";
1046 throw new NotSupportedException(text, ex);
1047 }
1048
1049 [MethodImpl(MethodImplOptions.NoInlining)]
1056
1057 [MethodImpl(MethodImplOptions.NoInlining)]
1063
1064 [MethodImpl(MethodImplOptions.NoInlining)]
1070
1071 [MethodImpl(MethodImplOptions.NoInlining)]
1077
1078 [MethodImpl(MethodImplOptions.NoInlining)]
1084
1085 [MethodImpl(MethodImplOptions.NoInlining)]
1091
1092 [MethodImpl(MethodImplOptions.NoInlining)]
1099
1100 [MethodImpl(MethodImplOptions.NoInlining)]
1106
1107 [MethodImpl(MethodImplOptions.NoInlining)]
1114
1115 [MethodImpl(MethodImplOptions.NoInlining)]
1122
1123 [MethodImpl(MethodImplOptions.NoInlining)]
1126 {
1127 if (state.Current.IsProcessingDictionary())
1128 {
1129 state.Current.JsonPropertyNameAsString = reader.GetString();
1130 }
1131 else
1132 {
1134 }
1136 }
1137
1138 [MethodImpl(MethodImplOptions.NoInlining)]
1144
1145 [MethodImpl(MethodImplOptions.NoInlining)]
1151
1152 [MethodImpl(MethodImplOptions.NoInlining)]
1155 {
1156 ref ReadStackFrame current = ref state.Current;
1157 byte[] jsonPropertyName;
1158 if (!reader.HasValueSequence)
1159 {
1160 jsonPropertyName = reader.ValueSpan.ToArray();
1161 }
1162 else
1163 {
1164 ReadOnlySequence<byte> sequence = reader.ValueSequence;
1166 }
1168 string @string = reader.GetString();
1170 }
1171
1172 [MethodImpl(MethodImplOptions.NoInlining)]
1179
1180 [MethodImpl(MethodImplOptions.NoInlining)]
1186
1187 [MethodImpl(MethodImplOptions.NoInlining)]
1193
1214
1215 [MethodImpl(MethodImplOptions.NoInlining)]
1221
1222 [MethodImpl(MethodImplOptions.NoInlining)]
1228
1229 [MethodImpl(MethodImplOptions.NoInlining)]
1235
1236 [MethodImpl(MethodImplOptions.NoInlining)]
1242
1247
1252
1253 [MethodImpl(MethodImplOptions.NoInlining)]
1259}
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static string ExpectedStartOfPropertyNotFound
Definition SR.cs:64
static string InvalidCharacterAfterEscapeWithinString
Definition SR.cs:80
static string CannotTranscodeInvalidUtf8
Definition SR.cs:24
static string NodeArrayTooSmall
Definition SR.cs:318
static string FormatUInt32
Definition SR.cs:114
static string CannotWriteValueWithinObject
Definition SR.cs:40
static string TrailingCommaNotAllowedBeforeArrayEnd
Definition SR.cs:148
static string DeserializePolymorphicInterface
Definition SR.cs:184
static string InvalidLeadingZeroInNumber
Definition SR.cs:212
static string MetadataPreservedArrayPropertyNotFound
Definition SR.cs:228
static string DeserializeUnableToConvertValue
Definition SR.cs:130
static string FormatInt16
Definition SR.cs:204
static string SerializeUnableToSerialize
Definition SR.cs:200
static string MetadataReferenceNotFound
Definition SR.cs:232
static string FormatDateTime
Definition SR.cs:138
static string ObjectDepthTooLarge
Definition SR.cs:100
static string UnexpectedEndOfDataWhileReadingComment
Definition SR.cs:172
static string CannotWriteValueAfterPrimitiveOrClose
Definition SR.cs:38
static string CannotStartObjectArrayAfterPrimitiveOrClose
Definition SR.cs:20
static string InvalidEndOfJsonNonPrimitive
Definition SR.cs:84
static string SerializationConverterOnAttributeNotCompatible
Definition SR.cs:186
static string FormatDateTimeOffset
Definition SR.cs:140
static string NodeAlreadyHasParent
Definition SR.cs:290
static string CannotEncodeInvalidUTF16
Definition SR.cs:30
static string InvalidCharacterAtStartOfComment
Definition SR.cs:170
static string CannotSkip
Definition SR.cs:174
static string InvalidCharacterWithinString
Definition SR.cs:82
static string SerializationDuplicateAttribute
Definition SR.cs:198
static string ValueTooLarge
Definition SR.cs:134
static string CannotReadInvalidUTF16
Definition SR.cs:18
static string CannotWriteEndAfterProperty
Definition SR.cs:98
static string NodeCollectionIsReadOnly
Definition SR.cs:314
static string FormatSingle
Definition SR.cs:112
static string ExpectedTrue
Definition SR.cs:70
static string InvalidCast
Definition SR.cs:78
static string FailedToGetLargerSpan
Definition SR.cs:74
static string MetadataPreservedArrayFailed
Definition SR.cs:224
static string SerializerOptionsImmutable
Definition SR.cs:152
static string NodeArrayIndexNegative
Definition SR.cs:316
static string ConstructorMaxOf64Parameters
Definition SR.cs:242
static string CannotPopulateCollection
Definition SR.cs:262
static string ConstructorParamIncompleteBinding
Definition SR.cs:240
static string SerializationNotSupportedType
Definition SR.cs:166
static string MetadataInvalidPropertyWithLeadingDollarSign
Definition SR.cs:236
static string MetadataValueWasNotString
Definition SR.cs:234
static string ExpectedJsonTokens
Definition SR.cs:54
static string MissingFSharpCoreMember
Definition SR.cs:326
static string FormatGuid
Definition SR.cs:144
static string RequiredDigitNotFoundAfterDecimal
Definition SR.cs:118
static string TypeRequiresAsyncSerialization
Definition SR.cs:168
static string InvalidComparison
Definition SR.cs:136
static string JsonElementHasWrongType
Definition SR.cs:90
static string NoMetadataForType
Definition SR.cs:312
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string PropertyNameTooLarge
Definition SR.cs:102
static string CannotDecodeInvalidBase64
Definition SR.cs:26
static string CommentHandlingMustBeValid
Definition SR.cs:94
static string IgnoreConditionOnValueTypeInvalid
Definition SR.cs:272
static string CannotEncodeInvalidUTF8
Definition SR.cs:32
static string SerializationConverterNotCompatible
Definition SR.cs:192
static string ArrayDepthTooLarge
Definition SR.cs:14
static string NodeDuplicateKey
Definition SR.cs:302
static string MetadataReferenceCannotContainOtherProperties
Definition SR.cs:230
static string NamingPolicyReturnNull
Definition SR.cs:196
static string MetadataDuplicateIdFound
Definition SR.cs:216
static string SerializerCycleDetected
Definition SR.cs:210
static string SerializationConverterOnAttributeInvalid
Definition SR.cs:188
static string ExpectedSeparatorAfterPropertyNameNotFound
Definition SR.cs:62
static string InvalidHexCharacterWithinString
Definition SR.cs:86
static string ExpectedStartOfPropertyOrValueNotFound
Definition SR.cs:66
static string CannotWritePropertyWithinArray
Definition SR.cs:34
static string FormatDecimal
Definition SR.cs:104
static string DeserializeNoConstructor
Definition SR.cs:182
static string SerializationDuplicateTypeAttribute
Definition SR.cs:164
static string MetadataInvalidReferenceToValueType
Definition SR.cs:220
static string ObjectWithParameterizedCtorRefMetadataNotHonored
Definition SR.cs:244
static string FormatByte
Definition SR.cs:202
static string SerializerPropertyNameConflict
Definition SR.cs:158
static string CannotSerializeInvalidMember
Definition SR.cs:260
static string OptionsAlreadyBoundToContext
Definition SR.cs:306
static string MetadataInvalidTokenAfterValues
Definition SR.cs:222
static string EndOfStringNotFound
Definition SR.cs:46
static string ExpectedStartOfPropertyOrValueAfterComment
Definition SR.cs:146
static string MetadataCannotParsePreservedObjectToImmutable
Definition SR.cs:214
static string SerializationConverterRead
Definition SR.cs:190
static string DeserializeUnableToAssignValue
Definition SR.cs:280
static string CannotSerializeInvalidType
Definition SR.cs:254
static string RequiredDigitNotFoundAfterSign
Definition SR.cs:120
static string ExpectedOneCompleteToken
Definition SR.cs:56
static string EndOfCommentNotFound
Definition SR.cs:44
static string CannotWriteCommentWithEmbeddedDelimiter
Definition SR.cs:156
static string ExpectedFalse
Definition SR.cs:52
static string TrailingCommaNotAllowedBeforeObjectEnd
Definition SR.cs:150
static string DeserializeWrongType
Definition SR.cs:132
static string FormatUInt64
Definition SR.cs:116
static string SerializationDataExtensionPropertyInvalid
Definition SR.cs:162
static string ExtensionDataCannotBindToCtorParam
Definition SR.cs:250
static string FormatBoolean
Definition SR.cs:268
static string MetadataIdIsNotFirstProperty
Definition SR.cs:218
static string SerializerPropertyNameNull
Definition SR.cs:160
static string FormatDouble
Definition SR.cs:106
static string CannotTranscodeInvalidUtf16
Definition SR.cs:28
static string NoMetadataForTypeCtorParams
Definition SR.cs:330
static string MultipleMembersBindWithConstructorParameter
Definition SR.cs:238
static string FormatUInt16
Definition SR.cs:208
static string NotEnoughData
Definition SR.cs:176
static string RequiredDigitNotFoundEndOfData
Definition SR.cs:122
static string BufferMaximumSizeExceeded
Definition SR.cs:18
static string MetadataPreservedArrayInvalidProperty
Definition SR.cs:226
static string ExpectedNextDigitEValueNotFound
Definition SR.cs:58
static string SerializerContextOptionsImmutable
Definition SR.cs:304
static string FormatSByte
Definition SR.cs:206
static string CannotReadIncompleteUTF16
Definition SR.cs:16
static string MaxDepthMustBePositive
Definition SR.cs:92
static string ExpectedEndOfDigitNotFound
Definition SR.cs:50
static string MismatchedObjectArray
Definition SR.cs:96
static string JsonIncludeOnNonPublicInvalid
Definition SR.cs:258
static string FormatTimeSpan
Definition SR.cs:142
static string DictionaryKeyTypeNotSupported
Definition SR.cs:270
static string NoMetadataForTypeProperties
Definition SR.cs:322
static string ExpectedStartOfValueNotFound
Definition SR.cs:68
static string ExpectedEndAfterSingleJson
Definition SR.cs:48
static string NodeValueNotAllowed
Definition SR.cs:298
static string ExpectedValueAfterPropertyNameNotFound
Definition SR.cs:72
static string FoundInvalidCharacter
Definition SR.cs:76
static string CannotWritePropertyAfterProperty
Definition SR.cs:36
static string DeserializeUnableToAssignNull
Definition SR.cs:282
static string FormatInt32
Definition SR.cs:108
static string SpecialNumberValuesNotSupported
Definition SR.cs:124
static string SerializationNotSupportedParentType
Definition SR.cs:248
static string NodeCycleDetected
Definition SR.cs:292
static string BuiltInConvertersNotRooted
Definition SR.cs:310
static string ZeroDepthAtEnd
Definition SR.cs:128
static string ConverterCanConvertMultipleTypes
Definition SR.cs:276
static string NumberHandlingOnPropertyInvalid
Definition SR.cs:274
static string UnexpectedEndOfLineSeparator
Definition SR.cs:178
static string DepthTooLarge
Definition SR.cs:42
static string SerializerConverterFactoryReturnsNull
Definition SR.cs:246
static string MetadataReferenceOfTypeCannotBeAssignedToType
Definition SR.cs:278
static string FormatInt64
Definition SR.cs:110
static string CannotStartObjectArrayWithoutProperty
Definition SR.cs:22
static string SerializerConverterFactoryReturnsJsonConverterFactory
Definition SR.cs:284
static string SerializationConverterWrite
Definition SR.cs:194
static string ExpectedNull
Definition SR.cs:60
Definition SR.cs:7
static string Utf8GetString(ReadOnlySpan< byte > bytes)
static MetadataPropertyName GetMetadataPropertyName(ReadOnlySpan< byte > propertyName)
static FormatException GetFormatException(DataType dateType)
static InvalidOperationException GetInvalidOperationException_ExpectedChar(JsonTokenType tokenType)
static void ThrowNotSupportedException_NodeCollectionIsReadOnly()
static void ThrowNotSupportedException_ConstructorMaxOf64Parameters(Type type)
static void ThrowJsonException_SerializerCycleDetected(int maxDepth)
static void ThrowArgumentException(string message)
static void ThrowInvalidOperationException_JsonIncludeOnNonPublicInvalid(string memberName, Type declaringType)
static void ThrowInvalidOperationException_SerializerOptionsImmutable(JsonSerializerContext context)
static void ThrowJsonException_MetadataValueWasNotString(JsonTokenType tokenType)
static void ThrowJsonException_MetadataValueWasNotString(JsonValueKind valueKind)
static void ThrowInvalidOperationException_NodeAlreadyHasParent()
static void ThrowArgumentException(ReadOnlySpan< char > propertyName, ReadOnlySpan< char > value)
static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(Type classType, Type attribute)
static FormatException GetFormatException(NumericType numericType)
static InvalidOperationException GetInvalidOperationException_ReadInvalidUTF8(DecoderFallbackException innerException)
static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan< byte > propertyName, int currentDepth)
static void ThrowInvalidOperationException_CannotSerializeInvalidType(Type type, Type parentClassType, MemberInfo memberInfo)
static InvalidOperationException GetJsonElementWrongTypeException(string expectedTypeName, JsonTokenType actualType)
static void ThrowJsonException_MetadataMissingIdBeforeValues(ref ReadStack state, ReadOnlySpan< byte > propertyName)
static void ThrowOutOfMemoryException(uint capacity)
static void ThrowNotSupportedException_BuiltInConvertersNotRooted(Type type)
static void ThrowInvalidOperationException(ExceptionResource resource, int currentDepth, byte token, JsonTokenType tokenType)
static void ReThrowWithPath(ref WriteStack state, Exception ex)
static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan< char > propertyName, int currentDepth)
static ArgumentOutOfRangeException GetArgumentOutOfRangeException_CommentEnumMustBeInRange(string parameterName)
static void ThrowInvalidOperationException_SerializerPropertyNameNull(Type parentType, JsonPropertyInfo jsonPropertyInfo)
static void ThrowInvalidOperationException_NumberHandlingOnPropertyInvalid(JsonPropertyInfo jsonPropertyInfo)
static InvalidOperationException GetInvalidOperationException_ExpectedNumber(JsonTokenType tokenType)
static void ThrowJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte=0, ReadOnlySpan< byte > bytes=default(ReadOnlySpan< byte >))
static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(ReadOnlySpan< byte > propertyName, ref ReadStack state)
static void ThrowMissingMemberException_MissingFSharpCoreMember(string missingFsharpCoreMember)
static void ThrowInvalidCastException_DeserializeUnableToAssignValue(Type typeOfValue, Type declaredType)
static InvalidOperationException GetInvalidOperationException_ExpectedObject(JsonTokenType tokenType)
static string GetResourceString(ExceptionResource resource, int currentDepth, byte token, JsonTokenType tokenType)
static void ThrowJsonException_SerializationConverterRead(JsonConverter converter)
static void ThrowJsonException_MetadataValuesInvalidToken(JsonTokenType tokenType)
static void ThrowNotSupportedException(ref ReadStack state, in Utf8JsonReader reader, NotSupportedException ex)
static InvalidOperationException GetInvalidOperationException(string message, Exception innerException)
static ArgumentOutOfRangeException GetArgumentOutOfRangeException(string parameterName, string message)
static void ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotHonored(ReadOnlySpan< byte > propertyName, ref Utf8JsonReader reader, ref ReadStack state)
static InvalidOperationException GetJsonElementWrongTypeException(JsonValueKind expectedType, JsonValueKind actualType)
static void ThrowInvalidOperationException_MetadataReferenceOfTypeCannotBeAssignedToType(string referenceId, Type currentType, Type typeToConvert)
static FormatException GetFormatException()
static InvalidOperationException GetJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
static void ThrowJsonException_MetadataInvalidReferenceToValueType(Type propertyType)
static void ThrowInvalidOperationException_SerializationConverterNotCompatible(Type converterType, Type type)
static void ThrowInvalidOperationException_SerializationDataExtensionPropertyInvalid(Type type, JsonPropertyInfo jsonPropertyInfo)
static string GetResourceString(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, string characters)
static void ThrowInvalidOperationException_DeserializeUnableToAssignNull(Type declaredType)
static InvalidOperationException GetJsonElementWrongTypeException(string expectedTypeName, JsonValueKind actualType)
static void ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(Type classTypeAttributeIsOn, MemberInfo memberInfo, Type typeToConvert)
static void ThrowArgumentException_InvalidCommentValue()
static void ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
static void ThrowArgumentException_NodeValueNotAllowed(string paramName)
static void ThrowInvalidOperationException(int currentDepth)
static ArgumentException GetArgumentException_ReadInvalidUTF16(EncoderFallbackException innerException)
static void ThrowArgumentException(ReadOnlySpan< char > propertyName, ReadOnlySpan< byte > value)
static void ThrowJsonException_MetadataReferenceNotFound(string id)
static void ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(string clrPropertyName, Type propertyDeclaringType)
static void ThrowArgumentException_NodeArrayTooSmall(string paramName)
static InvalidOperationException GetInvalidOperationException_ExpectedStringComparison(JsonTokenType tokenType)
static void ThrowJsonException_MetadataDuplicateIdFound(string id)
static InvalidOperationException GetInvalidOperationException(string message, JsonTokenType tokenType)
static void ThrowInvalidOperationException_SerializationDuplicateAttribute(Type attribute, Type classType, MemberInfo memberInfo)
static InvalidOperationException GetInvalidOperationException(string message)
static ArgumentOutOfRangeException GetArgumentOutOfRangeException_MaxDepthMustBePositive(string parameterName)
static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsJsonConverterFactorty(Type converterType)
static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties()
static void ThrowArgumentException_InvalidUTF8(ReadOnlySpan< byte > value)
static InvalidOperationException GetInvalidOperationException_ExpectedArray(JsonTokenType tokenType)
static void ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type keyType, JsonConverter converter)
static void ThrowNotSupportedException_CannotPopulateCollection(Type type, ref Utf8JsonReader reader, ref ReadStack state)
static void ThrowInvalidOperationException_JsonSerializerOptionsAlreadyBoundToContext()
static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute< TAttribute >(Type classType)
static void ThrowInvalidOperationException_ReadInvalidUTF16()
static void ThrowInvalidOperationException_NeedLargerSpan()
static void ThrowInvalidOperationException_NodeCycleDetected()
static ArgumentException GetArgumentException(string message)
static void AddJsonExceptionInformation(ref WriteStack state, JsonException ex)
static void ThrowInvalidOperationException_NoMetadataForTypeProperties(JsonSerializerContext context, Type type)
static void ThrowInvalidOperationException_NoMetadataForType(Type type)
static void ReThrowWithPath(ref ReadStack state, in Utf8JsonReader reader, Exception ex)
static void AddJsonExceptionInformation(ref ReadStack state, in Utf8JsonReader reader, JsonException ex)
static InvalidOperationException GetInvalidOperationException_ExpectedString(JsonTokenType tokenType)
static void ThrowInvalidOperationException_ReadInvalidUTF16(int charAsInt)
static void ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(Type classType, MemberInfo memberInfo)
static void ThrowNotSupportedException_NoMetadataForType(Type type)
static void ThrowArgumentException_DeserializeWrongType(Type type, object value)
static void ThrowArgumentException_PropertyNameTooLarge(int tokenLength)
static JsonException GetJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, ReadOnlySpan< byte > bytes)
static void ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters(Type parentType, string parameterName, string firstMatchName, string secondMatchName)
static InvalidOperationException GetInvalidOperationException_ExpectedComment(JsonTokenType tokenType)
static void ThrowOutOfMemoryException_BufferMaximumSizeExceeded(uint capacity)
static NotSupportedException NotSupportedException_NodeCollectionIsReadOnly()
static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(ref ReadStack state, Type propertyType)
static void ThrowInvalidOperationException_SerializerPropertyNameConflict(Type type, JsonPropertyInfo jsonPropertyInfo)
static InvalidOperationException GetInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType)
static InvalidOperationException GetInvalidOperationException_CannotSkipOnPartial()
static void ReThrowWithPath(ref ReadStack state, JsonReaderException ex)
static void ThrowInvalidOperationException_NamingPolicyReturnNull(JsonNamingPolicy namingPolicy)
static void ThrowArgumentException_ValueTooLarge(int tokenLength)
static InvalidOperationException GetInvalidOperationException(JsonTokenType tokenType)
static void ThrowArgumentException(ReadOnlySpan< byte > propertyName, ReadOnlySpan< byte > value)
static void ThrowArgumentOutOfRangeException_NodeArrayIndexNegative(string paramName)
static void ThrowJsonException_MetadataInvalidPropertyWithLeadingDollarSign(ReadOnlySpan< byte > propertyName, ref ReadStack state, in Utf8JsonReader reader)
static void ThrowJsonException_MetadataPreservedArrayInvalidProperty(ref ReadStack state, Type propertyType, in Utf8JsonReader reader)
static void ThrowNotSupportedException(ref WriteStack state, NotSupportedException ex)
static string GetPrintableString(byte value)
static void ThrowJsonException_MetadataIdIsNotFirstProperty(ReadOnlySpan< byte > propertyName, ref ReadStack state)
static void ThrowJsonException(string message=null)
static InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int currentDepth, byte token, JsonTokenType tokenType)
static void ThrowInvalidOperationException_NoMetadataForTypeCtorParams(JsonSerializerContext context, Type type)
static void ThrowNotSupportedException_TypeRequiresAsyncSerialization(Type propertyType)
static void ThrowJsonException_SerializationConverterWrite(JsonConverter converter)
static void ThrowArgumentException_DuplicateKey(string propertyName)
static void ThrowJsonException_MetadataCannotParsePreservedObjectIntoImmutable(Type propertyType)
static void ThrowInvalidOperationException_ConverterCanConvertMultipleTypes(Type runtimePropertyType, JsonConverter jsonConverter)
static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(Type converterType)
static void ThrowNotSupportedException_SerializationNotSupported(Type propertyType)
static void ThrowNotSupportedException_DeserializeNoConstructor(Type type, ref Utf8JsonReader reader, ref ReadStack state)
static void ThrowArgumentException_InvalidUTF16(int charAsInt)
static void ThrowInvalidOperationException_ConstructorParameterIncompleteBinding(Type parentType)
static bool IsPrintable(byte value)
static void ThrowInvalidOperationException_ExtensionDataCannotBindToCtorParam(JsonPropertyInfo jsonPropertyInfo)
static void ThrowArgumentException(ReadOnlySpan< byte > propertyName, ReadOnlySpan< char > value)
static void ThrowUnexpectedMetadataException(ReadOnlySpan< byte > propertyName, ref Utf8JsonReader reader, ref ReadStack state)
static void ThrowArgumentException_ValueNotSupported()
static void ThrowInvalidOperationException(string message)