Skip to content

OpenAPI_Error

mattpolzin edited this page Jun 11, 2021 · 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

public let localizedDescription: String

codingPath

public let codingPath: [CodingKey]

underlyingError

public let underlyingError: Swift.Error

codingPathString

public var codingPathString: String 

description

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