PCFError

public struct PCFError: Error, Decodable

PCFError model.

  • An error identifier used for API error.

    Declaration

    Swift

    public let code: Int
  • A human (end user friendly) readable/comprehensible description of the error.

    Declaration

    Swift

    public let message: String
  • Initializes a PCF error.

    • Parameters:
      • code: The error code to use.
      • message: The error message to use.

    Declaration

    Swift

    public init(code: Int, message: String)

    Parameters

    code

    The error code to use.

    message

    The error message to use.

  • Initializes a PCF error.

    • Parameters:
      • code: The error code to use.
      • message: The error message to use.

    Declaration

    Swift

    public init?(json: JSON)

    Parameters

    json

    JSON representation of object.

    Return Value

    New instance when JSON parsing successful, false otherwise.

  • Error for mal-formatted JSON, such as receiving arrays when expecting dictionaries as response.

    Declaration

    Swift

    public static var invalidJSON: PCFError