Table of Contents

Class JsonExtractionException

Namespace
JsonAssertions
Assembly
JsonAssertions.TUnit.dll

Thrown by the GetJsonValue / GetJsonString / GetJsonElement extraction helpers when the requested value cannot be produced: the path does not resolve, the value at the path is the wrong JSON kind, its text does not parse to the requested type, or the source text is not valid JSON. The message carries the same path-context diagnostics the assertions render (how far the path resolved and why it stopped), so an extraction failure explains itself rather than surfacing a bare KeyNotFoundException or FormatException from a hand-rolled GetProperty(...).GetInt32() chain.

public sealed class JsonExtractionException : Exception, ISerializable
Inheritance
JsonExtractionException
Implements
Inherited Members
Extension Methods

Constructors

JsonExtractionException()

Initializes the exception with no message.

public JsonExtractionException()

JsonExtractionException(string)

Initializes the exception with a rendered, path-context failure message.

public JsonExtractionException(string message)

Parameters

message string

The explanatory failure message.

JsonExtractionException(string, Exception)

Initializes the exception with a message and an inner cause.

public JsonExtractionException(string message, Exception innerException)

Parameters

message string

The explanatory failure message.

innerException Exception

The underlying cause.