1 type derived from JsonException
System.Text.Json (1)
System\Text\Json\Reader\JsonReaderException.cs (1)
10internal sealed class JsonReaderException : JsonException
136 instantiations of JsonException
IdentitySample.PasskeyConformance (1)
Data\ServerPublicKeyCredentialOptionsResponse.cs (1)
23?? throw new JsonException("Could not parse the creation options JSON.");
Microsoft.AspNetCore.Components.Server (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34throw new JsonException($"Unexpected JSON property '{reader.GetString()}'."); 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 45throw new JsonException("__internalId is required.");
Microsoft.AspNetCore.Components.Web (13)
WebEventData\ChangeEventArgsReader.cs (1)
43throw new JsonException($"Unknown property {property.Name}");
WebEventData\ClipboardEventArgsReader.cs (1)
25throw new JsonException($"Unknown property {property.Name}");
WebEventData\DragEventArgsReader.cs (2)
73throw new JsonException($"Unknown property {property.Name}"); 95throw new JsonException($"Unknown property {property.Name}");
WebEventData\ErrorEventArgsReader.cs (1)
45throw new JsonException($"Unknown property {property.Name}");
WebEventData\FocusEventArgsReader.cs (1)
25throw new JsonException($"Unknown property {property.Name}");
WebEventData\KeyboardEventArgsReader.cs (1)
70throw new JsonException($"Unknown property {property.Name}");
WebEventData\MouseEventArgsReader.cs (1)
117throw new JsonException($"Unknown property {property.Name}");
WebEventData\ProgressEventArgReader.cs (1)
40throw new JsonException($"Unknown property {property.Name}");
WebEventData\TouchEventArgsReader.cs (2)
72throw new JsonException($"Unknown property {property.Name}"); 126throw new JsonException($"Unknown property {property.Name}");
WebEventData\WebEventDescriptorReader.cs (2)
38throw new JsonException($"Unknown property {property.Name}"); 72throw new JsonException($"Unknown property {property.Name}");
Microsoft.AspNetCore.Components.WebAssembly (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34throw new JsonException($"Unexpected JSON property '{reader.GetString()}'."); 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 45throw new JsonException("__internalId is required.");
Microsoft.AspNetCore.Components.WebView (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34throw new JsonException($"Unexpected JSON property '{reader.GetString()}'."); 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 45throw new JsonException("__internalId is required.");
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
ConverterTests\JsonElementComparer.cs (2)
95throw new JsonException(string.Format(CultureInfo.InvariantCulture, "Unknown JsonValueKind {0}", x.ValueKind)); 153throw new JsonException(string.Format(CultureInfo.InvariantCulture, "Unknown JsonValueKind {0}", obj.ValueKind));
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (2)
514var jsonException = new JsonException(); 555var jsonException = new JsonException();
Microsoft.AspNetCore.Identity (2)
Passkeys\BufferSourceJsonConverter.cs (2)
24throw new JsonException("Unexpected escaped value in base64url string."); 30throw new JsonException("Expected a valid base64url string.");
Microsoft.AspNetCore.JsonPatch.SystemTextJson (4)
Converters\JsonConverterForJsonPatchDocumentOfT.cs (2)
27throw new JsonException(Resources.InvalidJsonPatchDocument); 49throw new JsonException(Resources.InvalidJsonPatchDocument, ex);
Converters\JsonPatchDocumentConverter.cs (2)
26throw new JsonException(Resources.InvalidJsonPatchDocument); 49throw new JsonException(Resources.InvalidJsonPatchDocument, ex);
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (6)
IntegrationTests\HeterogenousCollectionTests.cs (3)
88throw new JsonException(); 104throw new JsonException("Unknown shape type"); 120throw new JsonException("Unknown shape type");
TestObjectModels\HeterogenousCollection.cs (3)
79throw new JsonException(); 93throw new JsonException(); 109throw new JsonException();
Microsoft.AspNetCore.OpenApi (6)
Schemas\OpenApiJsonSchema.cs (3)
22throw new JsonException("Expected StartObject token to represent beginning of schema."); 30var propertyName = reader.GetString() ?? throw new JsonException("Encountered unexpected missing property name."); 40throw new JsonException("Encountered unexpected EOF token without producing a schema.");
Schemas\OpenApiJsonSchema.Helpers.cs (3)
66throw new JsonException("Expected StartObject or Null"); 75throw new JsonException("Expected PropertyName"); 160throw new JsonException("Expected PropertyName");
Microsoft.CodeAnalysis.LanguageServer.Protocol (25)
Protocol\Converters\FormattingOptionsConverter.cs (4)
31throw new JsonException(LanguageServerProtocolResources.FormattingOptionsEndedUnexpectedly); 40throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.FormattingOptionsMissingRequiredProperty, propertyName)); 74throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.FormattingOptionsEncounteredInvalidToken, reader.TokenType)); 108_ => throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.FormattingOptionsEncounteredInvalidToken, reader.TokenType))
Protocol\Converters\NaturalObjectConverter.cs (1)
70throw new JsonException();
Protocol\Converters\StringEnumConverter.cs (1)
49throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.StringEnumSerializationError, reader.GetString()));
Protocol\Converters\SumConverter.cs (2)
216throw new JsonException(LanguageServerProtocolResources.NoSumTypeMatch); 255throw new JsonException($"No sum type match for {objectType}");
Protocol\Converters\TextDocumentSyncConverter.cs (1)
42throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.TextDocumentSyncSerializationError, reader.GetString()));
Protocol\Internal\Converters\ClassifiedTextElementConverter.cs (2)
46throw new JsonException($"Expected {ObjectContentConverter.TypeProperty} property value {nameof(ClassifiedTextElement)}"); 55throw new JsonException();
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (4)
23throw new JsonException($"Expected {ObjectContentConverter.TypeProperty} property value {nameof(ClassifiedTextRun)}"); 34throw new JsonException("Expected start object or null tokens"); 48throw new JsonException(); 54throw new JsonException();
Protocol\Internal\Converters\ContainerElementConverter.cs (3)
30return new ContainerElement(style ?? throw new JsonException(), objects); 54throw new JsonException($"Expected {ObjectContentConverter.TypeProperty} property value {nameof(ContainerElement)}"); 64throw new JsonException();
Protocol\Internal\Converters\ImageElementConverter.cs (3)
30imageId ??= imageId ?? throw new JsonException(); 51throw new JsonException($"Expected {ObjectContentConverter.TypeProperty} property value {nameof(ImageElement)}"); 61throw new JsonException("Expected start object or null tokens");
Protocol\Internal\Converters\ImageIdConverter.cs (3)
30throw new JsonException("Expected properties Guid and Id to be present"); 52throw new JsonException($"Expected {ObjectContentConverter.TypeProperty} property value {nameof(ImageId)}"); 62throw new JsonException("Expected start object or null tokens");
Protocol\Internal\Converters\ObjectContentConverter.cs (1)
50var type = data.GetProperty(TypeProperty).GetString() ?? throw new JsonException();
Microsoft.Extensions.AI.Abstractions (2)
Embeddings\BinaryEmbedding.cs (2)
52throw new JsonException("Expected string property."); 77_ => throw new JsonException("Expected binary character sequence.")
Microsoft.Extensions.AI.Evaluation.Reporting (8)
JsonSerialization\EvaluationContextConverter.cs (5)
27throw new JsonException($"Unexpected token '{reader.TokenType}'."); 45throw new JsonException( 54throw new JsonException( 64throw new JsonException( 77throw new JsonException($"Missing required properties '{NamePropertyName}' and '{ContentsPropertyName}'.");
Storage\DiskBasedResponseCache.CacheEntry.cs (2)
44throw new JsonException( 61throw new JsonException(
Storage\DiskBasedResultStore.cs (1)
75? throw new JsonException(
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (8)
src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting\CSharp\JsonSerialization\EvaluationContextConverter.cs (5)
27throw new JsonException($"Unexpected token '{reader.TokenType}'."); 45throw new JsonException( 54throw new JsonException( 64throw new JsonException( 77throw new JsonException($"Missing required properties '{NamePropertyName}' and '{ContentsPropertyName}'.");
Storage\AzureStorageResponseCache.CacheEntry.cs (2)
49?? throw new JsonException( 67?? throw new JsonException(
Storage\AzureStorageResultStore.cs (1)
119?? throw new JsonException(
Microsoft.JSInterop (22)
Implementation\JSObjectReferenceJsonWorker.cs (3)
38throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 43throw new JsonException($"Unexpected JSON token {reader.TokenType}"); 49throw new JsonException($"Required property {JSObjectIdKey} not found.");
Infrastructure\ByteArrayJsonConverter.cs (8)
33throw new JsonException("JSON serialization is attempting to deserialize an unexpected byte array."); 40throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'StartObject'."); 47throw new JsonException($"Unexpected JSON Property {reader.GetString()}."); 51throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'Number'."); 55throw new JsonException($"Unexpected number, expected 32-bit integer."); 60throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'PropertyName'."); 65throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'EndObject'."); 70throw new JsonException($"Byte array {byteArrayRef} not found.");
Infrastructure\DotNetDispatcher.cs (4)
232throw new JsonException("Invalid JSON"); 259throw new JsonException($"Unexpected JSON token {reader.TokenType}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters."); 319throw new JsonException("Invalid JSON"); 336throw new JsonException("Invalid JSON");
Infrastructure\DotNetObjectReferenceJsonConverter.cs (3)
37throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 42throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 48throw new JsonException($"Required property {DotNetObjectRefKey} not found.");
Infrastructure\JSStreamReferenceJsonConverter.cs (4)
45throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 50throw new JsonException($"Unexpected JSON token {reader.TokenType}"); 56throw new JsonException($"Required property {JSObjectReferenceJsonWorker.JSObjectIdKey} not found."); 61throw new JsonException($"Required property {_jsStreamReferenceLengthKey} not found.");
Microsoft.ML.Tokenizers (1)
Utils\StringSpanOrdinalKey.cs (1)
166throw new JsonException("Invalid JSON.");
Roslyn.VisualStudio.Next.UnitTests (2)
UnifiedSettings\TestModel\ResourceStringArrayConverter.cs (2)
17throw new JsonException("Expected StartArray token"); 32throw new JsonException("Token should be string");
System.Text.Json (19)
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (2)
54throw new JsonException(); 75throw new JsonException();
System\Text\Json\ThrowHelper.Serialization.cs (17)
52throw new JsonException(SR.Format(SR.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true }; 70throw new JsonException(SR.Format(SR.PropertyGetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true }; 76throw new JsonException(SR.Format(SR.PropertySetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true }; 82throw new JsonException(SR.Format(SR.ConstructorParameterDisallowNull, parameterName, declaringType)) { AppendPathInformation = true }; 130throw new JsonException(SR.Format(SR.SerializationConverterRead, converter)) { AppendPathInformation = true }; 136throw new JsonException(SR.Format(SR.SerializationConverterWrite, converter)) { AppendPathInformation = true }; 142throw new JsonException(SR.Format(SR.SerializerCycleDetected, maxDepth)) { AppendPathInformation = true }; 148throw new JsonException(message) { AppendPathInformation = true }; 323throw new JsonException(SR.Format(SR.JsonRequiredPropertiesMissing, parent.Type, listOfMissingPropertiesBuilder.ToString())); 329throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_JsonPropertyInfo, property.Name, property.DeclaringType)); 335throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed)); 341throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name))); 348throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name))); 492throw new JsonException(message, path, ex.LineNumber, ex.BytePositionInLine, ex); 498JsonException jsonException = new JsonException(null, ex); 536JsonException jsonException = new JsonException(null, ex); 736throw new JsonException(SR.Format(SR.UnmappedJsonProperty, unmappedPropertyName, type));
System.Windows.Forms.Tests (4)
System\Windows\Forms\DataObjectTests.cs (4)
3032throw new JsonException(); 3041throw new JsonException(); 3066throw new JsonException(); 3070throw new JsonException();
218 references to JsonException
aspire (1)
DotNet\DotNetCliRunner.cs (1)
796catch (JsonException ex)
Aspire.Dashboard (1)
Components\Dialogs\TextVisualizerDialog.razor.cs (1)
177catch (JsonException)
Aspire.Hosting (2)
Dashboard\DashboardLifecycleHook.cs (1)
736catch (JsonException)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
100catch (JsonException ex)
Aspire.Hosting.Azure (2)
AzureDeployingContext.cs (1)
447catch (JsonException) { }
Provisioning\Internal\DefaultUserSecretsManager.cs (1)
66catch (JsonException ex)
Aspire.Hosting.Azure.Functions (1)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
100catch (JsonException ex)
Aspire.Hosting.OpenAI (1)
StatusPageHealthCheck.cs (1)
110catch (JsonException jex)
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
364catch (JsonException ex)
Microsoft.AspNetCore.Components.Server.Tests (6)
ElementReferenceJsonConverterTest.cs (4)
84var ex = Assert.Throws<JsonException>(() => 103var ex = Assert.Throws<JsonException>(() =>
ProtectedBrowserStorageTest.cs (2)
177var ex = await Assert.ThrowsAsync<JsonException>(
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\JsonRequestHelpers.cs (1)
306catch (JsonException ex)
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
ProblemDetailsJsonConverterTest.cs (1)
28Assert.IsAssignableFrom<JsonException>(ex);
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
1421catch (JsonException ex)
Microsoft.AspNetCore.Http.Extensions.Tests (6)
HttpRequestJsonExtensionsTests.cs (2)
57var ex = await Assert.ThrowsAsync<JsonException>(async () => await context.Request.ReadFromJsonAsync<int>());
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (4)
514var jsonException = new JsonException(); 555var jsonException = new JsonException(); 613Assert.IsType<JsonException>(logMessage.Exception); 655Assert.IsType<JsonException>(badHttpRequestException.InnerException);
Microsoft.AspNetCore.Identity (10)
PasskeyExceptionExtensions.cs (5)
108public static PasskeyException InvalidAttestationCredentialJsonFormat(JsonException ex) 114public static PasskeyException InvalidAssertionCredentialJsonFormat(JsonException ex) 120public static PasskeyException InvalidClientDataJsonFormat(JsonException ex) 132public static PasskeyException InvalidAttestationStateJsonFormat(JsonException ex) 135public static PasskeyException InvalidAssertionStateJsonFormat(JsonException ex)
PasskeyHandler.cs (5)
227catch (JsonException ex) 242catch (JsonException ex) 382catch (JsonException ex) 397catch (JsonException ex) 578catch (JsonException ex)
Microsoft.AspNetCore.Identity.Test (2)
Passkeys\PasskeyScenarioTest.cs (2)
95catch (JsonException ex) 120catch (JsonException ex)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (4)
JsonPatchDocumentTest.cs (4)
174var exception = Assert.Throws<JsonException>(() => 191var exception = Assert.Throws<JsonException>(() =>
Microsoft.AspNetCore.Mvc.Core (2)
Formatters\SystemTextJsonInputFormatter.cs (2)
88catch (JsonException jsonException) 133private Exception WrapExceptionForModelState(JsonException jsonException)
Microsoft.AspNetCore.OpenApi (1)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
56/// <exception cref="JsonException">Thrown if JSON object is not valid.</exception>
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
417catch (JsonException ex) 475catch (JsonException jrex)
Microsoft.AspNetCore.SignalR.Tests (2)
HubConnectionHandlerTests.cs (2)
3832Assert.IsType<System.Text.Json.JsonException>(state.DisconnectedException); 3855Assert.IsType<System.Text.Json.JsonException>(state.DisconnectedException);
Microsoft.CodeAnalysis.Features (1)
PdbSourceDocument\SourceLinkMap.cs (1)
62/// <exception cref="JsonException"><paramref name="json"/> is not valid JSON string.</exception>
Microsoft.CodeAnalysis.LanguageServer (1)
FileBasedPrograms\VirtualProjectXmlProvider.cs (1)
133catch (JsonException ex)
Microsoft.Extensions.AI.Abstractions (6)
Functions\AIFunctionFactory.cs (6)
110/// <exception cref="JsonException">A parameter to <paramref name="method"/> is not serializable.</exception> 183/// <exception cref="JsonException">A parameter to <paramref name="method"/> is not serializable.</exception> 276/// <exception cref="JsonException">A parameter to <paramref name="method"/> or its return type is not serializable.</exception> 359/// <exception cref="JsonException">A parameter to <paramref name="method"/> or its return type is not serializable.</exception> 463/// <exception cref="JsonException">A parameter to <paramref name="method"/> or its return type is not serializable.</exception> 840catch (JsonException)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\FunctionCallContentTests..cs (1)
300[InlineData(typeof(JsonException))]
Embeddings\BinaryEmbeddingTests.cs (1)
93Assert.Throws<JsonException>(() => JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.Embedding));
Microsoft.Extensions.AI.Evaluation.Quality (4)
IntentResolutionEvaluator.cs (2)
345catch (JsonException) 370catch (JsonException ex)
RelevanceTruthAndCompletenessEvaluator.cs (2)
293catch (JsonException) 318catch (JsonException ex)
Microsoft.Extensions.AI.Evaluation.Tests (6)
IntentResolutionRatingTests.cs (3)
286Assert.Throws<JsonException>(() => IntentResolutionRating.FromJson(json)); 302Assert.Throws<JsonException>(() => IntentResolutionRating.FromJson(json)); 322Assert.Throws<JsonException>(() => IntentResolutionRating.FromJson(json));
RelevanceTruthAndCompletenessRatingTests.cs (3)
342Assert.Throws<JsonException>(() => RelevanceTruthAndCompletenessRating.FromJson(json)); 358Assert.Throws<JsonException>(() => RelevanceTruthAndCompletenessRating.FromJson(json)); 380Assert.Throws<JsonException>(() => RelevanceTruthAndCompletenessRating.FromJson(json));
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
126catch (JsonException)
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (2)
254var ex = Assert.Throws<JsonException>(() => response.Result);
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationProvider.cs (1)
32catch (JsonException e)
Microsoft.JSInterop.Tests (48)
Infrastructure\ByteArrayJsonConverterTest.cs (17)
25var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions)); 38var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions)); 51var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions)); 65Assert.IsAssignableFrom<JsonException>(ex); 89var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions)); 121var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions)); 137var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions)); 153var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions)); 169var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<byte[]>(json, JsonSerializerOptions));
Infrastructure\DotNetDispatcherTest.cs (10)
346Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.EndInvokeJS(jsRuntime, "")); 357Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.EndInvokeJS(jsRuntime, $"{{\"key\": \"{jsRuntime.LastInvocationAsyncHandle}\"}}")); 368Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, false")); 379Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.EndInvokeJS(jsRuntime, $"[{jsRuntime.LastInvocationAsyncHandle}, false, \"Hello\", 5]")); 572Assert.Throws<JsonException>(() => 611var ex = Assert.Throws<JsonException>(() => 795Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) })); 804Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) })); 813Assert.ThrowsAny<JsonException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(string) }));
Infrastructure\DotNetObjectReferenceJsonConverterTest.cs (6)
23var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<DotNetObjectReference<TestModel>>(json, JsonSerializerOptions)); 37var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<DotNetObjectReference<TestModel>>(json, JsonSerializerOptions)); 53Assert.IsAssignableFrom<JsonException>(ex); 68Assert.IsAssignableFrom<JsonException>(ex);
Infrastructure\JSObjectReferenceJsonConverterTest.cs (6)
27var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<IJSObjectReference>(json, JsonSerializerOptions)); 38var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<IJSObjectReference>(json, JsonSerializerOptions)); 50Assert.IsAssignableFrom<JsonException>(ex); 61Assert.IsAssignableFrom<JsonException>(ex);
Infrastructure\JSStreamReferenceJsonConverterTest.cs (8)
27var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<IJSStreamReference>(json, JsonSerializerOptions)); 38var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<IJSStreamReference>(json, JsonSerializerOptions)); 50Assert.IsAssignableFrom<JsonException>(ex); 61Assert.IsAssignableFrom<JsonException>(ex); 72var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<IJSStreamReference>(json, JsonSerializerOptions));
JSRuntimeTest.cs (1)
232Assert.IsAssignableFrom<JsonException>(jsException.InnerException);
Roslyn.VisualStudio.Next.UnitTests (1)
Services\ServiceHubServicesTests_ExtensionMessageHandler.cs (1)
380Assert.IsType<JsonException>(result.ExtensionException);
System.Text.Json (98)
src\libraries\System.Text.Json\Common\JsonCommentHandling.cs (1)
14/// <see cref="JsonException"/> is thrown.
System\Text\Json\Document\JsonDocument.Parse.cs (8)
41/// <exception cref="JsonException"> 71/// <exception cref="JsonException"> 116/// <exception cref="JsonException"> 202/// <exception cref="JsonException"> 276/// <exception cref="JsonException"> 343/// <exception cref="JsonException"> 391/// <exception cref="JsonException"> 431/// <exception cref="JsonException">
System\Text\Json\Document\JsonDocumentOptions.cs (4)
25/// By default <exception cref="JsonException"/> is thrown if a comment is encountered. 47/// Reading past this depth will throw a <exception cref="JsonException"/>. 68/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if a trailing comma is encountered. 77/// By default, it's set to true. If set to false, <see cref="JsonException"/> is thrown
System\Text\Json\Document\JsonElement.Parse.cs (5)
44/// <exception cref="JsonException"> 82/// <exception cref="JsonException"><paramref name="utf8Json"/> does not represent a valid single JSON value.</exception> 96/// <exception cref="JsonException"><paramref name="json"/> does not represent a valid single JSON value.</exception> 111/// <exception cref="JsonException"><paramref name="json"/> does not represent a valid single JSON value.</exception> 156/// <exception cref="JsonException">
System\Text\Json\Nodes\JsonNode.Parse.cs (5)
44/// <exception cref="JsonException"> 67/// <exception cref="JsonException"> 90/// <exception cref="JsonException"> 112/// <exception cref="JsonException"> 137/// <exception cref="JsonException">
System\Text\Json\Reader\JsonReaderOptions.cs (4)
25/// By default <exception cref="JsonException"/> is thrown if a comment is encountered. 49/// Reading past this depth will throw a <exception cref="JsonException"/>. 70/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if a trailing comma is encountered. 79/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if trailing content is encountered after the first top-level JSON value.
System\Text\Json\Reader\Utf8JsonReader.cs (3)
274/// <exception cref="JsonException"> 298/// <exception cref="JsonException"> 352/// <exception cref="JsonException">
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
657private JsonException GetInvalidLiteralMultiSegment(ReadOnlySpan<byte> span)
System\Text\Json\Serialization\JsonConverterOfT.ReadCore.cs (1)
74case JsonException jsonEx when jsonEx.Path is null:
System\Text\Json\Serialization\JsonConverterOfT.WriteCore.cs (1)
33case JsonException { Path: null } jsonException:
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (4)
22/// <exception cref="JsonException"> 50/// <exception cref="JsonException"> 83/// <exception cref="JsonException"> 137/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Element.cs (4)
19/// <exception cref="JsonException"> 45/// <exception cref="JsonException"> 73/// <exception cref="JsonException"> 121/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (4)
21/// <exception cref="JsonException"> 43/// <exception cref="JsonException"> 70/// <exception cref="JsonException"> 112/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Pipe.cs (5)
32/// <exception cref="JsonException"> 68/// <exception cref="JsonException"> 98/// <exception cref="JsonException"> 128/// <exception cref="JsonException"> 169/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (5)
20/// <exception cref="JsonException"> 47/// <exception cref="JsonException"> 73/// <exception cref="JsonException"> 92/// <exception cref="JsonException"> 114/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (10)
32/// <exception cref="JsonException"> 65/// <exception cref="JsonException"> 100/// <exception cref="JsonException"> 135/// <exception cref="JsonException"> 172/// <exception cref="JsonException"> 202/// <exception cref="JsonException"> 229/// <exception cref="JsonException"> 255/// <exception cref="JsonException"> 284/// <exception cref="JsonException"> 322/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (10)
28/// <exception cref="JsonException"> 62/// <exception cref="JsonException"> 97/// <exception cref="JsonException"> 135/// <exception cref="JsonException"> 178/// <exception cref="JsonException"> 214/// <exception cref="JsonException"> 248/// <exception cref="JsonException"> 275/// <exception cref="JsonException"> 306/// <exception cref="JsonException"> 351/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (7)
21/// <exception cref="JsonException"> 75/// <exception cref="JsonException"> 127/// <exception cref="JsonException"> 173/// <exception cref="JsonException"> 223/// <exception cref="JsonException"> 288catch (JsonException) 313catch (JsonException)
System\Text\Json\Serialization\JsonSerializerOptions.cs (4)
305/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if a trailing comma is encountered. 574/// Going past this depth will throw a <exception cref="JsonException"/>. 645/// By default <exception cref="JsonException"/> is thrown if a comment is encountered. 858/// By default, it's set to true. If set to false, <see cref="JsonException"/> is thrown
System\Text\Json\Serialization\ReferenceHandler.cs (2)
34/// * A <see cref="JsonException"/> is thrown if a `$ref` metadata property is found within the JSON object. 44/// If the JSON is not well-formed, a <see cref="JsonException"/> is thrown.
System\Text\Json\ThrowHelper.cs (1)
376public static JsonException GetJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, ReadOnlySpan<byte> bytes)
System\Text\Json\ThrowHelper.Serialization.cs (4)
498JsonException jsonException = new JsonException(null, ex); 503public static void AddJsonExceptionInformation(scoped ref ReadStack state, in Utf8JsonReader reader, JsonException ex) 536JsonException jsonException = new JsonException(null, ex); 541public static void AddJsonExceptionInformation(ref WriteStack state, JsonException ex)
System\Text\Json\Writer\JsonWriterOptions.cs (1)
97/// Reading past this depth will throw a <exception cref="JsonException"/>.
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (4)
19/// <exception cref="JsonException"> 52/// <exception cref="JsonException"> 83/// <exception cref="JsonException"> 119/// <exception cref="JsonException">