Skip to content

OpenAPI_Error

mattpolzin edited this page Sep 28, 2020 · 4 revisions

OpenAPI.Error

An OpenAPI.Error can be constructed from any error thrown while decoding an OpenAPI document. This wrapper provides a superior human-readable error and a human readable coding path.

public struct Error: Swift.Error, CustomStringConvertible

Example:

do {
    document = try JSONDecoder().decode(OpenAPI.Document.self, from: ...)
} catch let error {
    let prettyError = OpenAPI.Error(from: error)
    print(prettyError.localizedDescription)
    print(prettyError.codingPathString)
}

Inheritance

CustomStringConvertible, Swift.Error

Initializers

init(from:)

public init(from underlyingError: Swift.Error)

Properties

localizedDescription

let localizedDescription: String

codingPath

let codingPath: [CodingKey]

underlyingError

let underlyingError: Swift.Error

codingPathString

var codingPathString: String

description

var description: String
Types
Protocols
Global Functions
Extensions
Clone this wiki locally