DecodingFailure class final
An error produced when a Decoder cannot produce a value from the focused Json.
Carries a Reason describing why decoding failed, and an IList of
CursorOps (the cursor's history) for constructing a human-readable
path to the failure site.
Constructors
-
DecodingFailure(Reason reason, IList<
CursorOp> history) -
Creates a DecodingFailure with the given
reasonand cursorhistory.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
history
→ IList<
CursorOp> -
The cursor operations leading to the failure, used to reconstruct a path.
final
-
pathToRootString
→ Option<
String> -
Returns a dot/bracket path string (e.g.
.user.address[0]) for the failure location, orNoneif the cursor was at the root.no setter - reason → Reason
-
The reason this failure occurred.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
message(
) → String - Returns a human-readable description of the failure.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
from(
Reason reason, ACursor cursor) → DecodingFailure -
Creates a DecodingFailure with
reason, deriving the history fromcursor. -
fromString(
String message, ACursor cursor) → DecodingFailure -
Creates a DecodingFailure with a CustomReason message, deriving the
history from
cursor.