DecodingError

public enum DecodingError : Error, Equatable

Undocumented

  • DecodingError.Metadata provides information about where an DecodingError was thrown in the JSON object graph.

    See more

    Declaration

    Swift

    public struct Metadata : Equatable
  • Thrown when optional casting from Any fails.

    This can happen both when trying to access a key on a object that isn’t a NSDictionary, and failing to cast a Castable primitive.

    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 RawRepresentable extension when init(rawValue:) returned nil.

    Declaration

    Swift

    case rawRepresentableInitializationError(rawValue: Any, Metadata)
  • When an error is thrown that isn’t DecodingError, it will be wrapped in DecodingError.other in 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 }