DecodingError
public enum DecodingError : Error, Equatable
Undocumented
-
See moreDecodingError.Metadataprovides information about where anDecodingErrorwas thrown in the JSON object graph.Declaration
Swift
public struct Metadata : Equatable -
Thrown when optional casting from
Anyfails.This can happen both when trying to access a key on a object that isn’t a
NSDictionary, and failing to cast aCastableprimitive.Declaration
Swift
case typeMismatch(expected: Any.Type, actual: Any.Type, Metadata) -
Thrown when a given, required, key was not found in a dictionary.
Declaration
Swift
case missingKey(String, Metadata) -
Thrown from the
RawRepresentableextension wheninit(rawValue:)returnednil.Declaration
Swift
case rawRepresentableInitializationError(rawValue: Any, Metadata) -
When an error is thrown that isn’t
DecodingError, it will be wrapped inDecodingError.otherin order to also provide metadata about where the error was thrown.Declaration
Swift
case other(Error, Metadata) -
Undocumented
Declaration
Swift
public var metadata: Metadata { get set } -
Undocumented
Declaration
Swift
public var debugDescription: String { get }
DecodingError Enumeration Reference