Skip to content

OpenAPIError

mattpolzin edited this page Jun 11, 2021 · 4 revisions

OpenAPIError

public protocol OpenAPIError: Swift.Error, CustomStringConvertible 

Inheritance

CustomStringConvertible, Swift.Error

Default Implementations

localizedDescription

Description of error given in the structure:​ subject context error:​ details

var localizedDescription: String 

A subject, context, and error are all guaranteed. The details are only provided in certain contexts.

description

var description: String 

Requirements

subjectName

The subject of the error (i.e. the thing being worked with when the error occurred).

var subjectName: String 

In the error description "Expected to find title key in Document.info but it is missing." the subject is "title".

contextString

The context of the error (i.e. where in the document the error occurred).

var contextString: String 

In the error description "Expected to find title key in Document.info but it is missing." the context is "Document.info".

errorCategory

The category of error that occurred.

var errorCategory: ErrorCategory 

The category can also carry a bit of contextual information that is only relevant for the given category.

In the error description "Expected to find title key in Document.info but it is missing." the category is .missing(.key).

codingPath

The complete coding path for where the error occurred.

var codingPath: [CodingKey] 

This will often overlap with the contextString but there is not a 1-1 relationship between the two. This is the same concept of "codingPath" as is used elsewhere for the Swift Codable featureset.

Types
Protocols
Global Functions
Extensions
Clone this wiki locally