DecodingError
An error that occurs during the decoding of a value.
enum DecodingError
An error that occurs during the decoding of a value.
enum DecodingError
import Swift
case dataCorrupted(DecodingError.Context)
An indication that the data is corrupted or otherwise invalid.
case keyNotFound(any CodingKey, DecodingError.Context)
An indication that a keyed decoding container was asked for an entry for the given key, but did not contain one.
case typeMismatch(any Any.Type, DecodingError.Context)
An indication that a value of the given type could not be decoded because it did not match the type of what was found in the encoded payload.
case valueNotFound(any Any.Type, DecodingError.Context)
An indication that a non-optional value of the given type was expected, but a null value was found.
protocol Error : Sendable
A type representing an error value that can be thrown.
protocol Sendable
static func dataCorruptedError<C>(forKey key: C.Key, in container: C, debugDescription: String) -> DecodingError where C : KeyedDecodingContainerProtocol
Returns a new .dataCorrupted
error using a constructed coding path and the given debug description.
static func dataCorruptedError(in container: any SingleValueDecodingContainer, debugDescription: String) -> DecodingError
Returns a new .dataCorrupted
error using a constructed coding path and the given debug description.
static func dataCorruptedError(in container: any UnkeyedDecodingContainer, debugDescription: String) -> DecodingError
Returns a new .dataCorrupted
error using a constructed coding path and the given debug description.
struct Context
The context in which the error occurred.
import FoundationEssentials
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Escapable
protocol LocalizedError : Error
Describes an error that provides localized messages describing why an error occurred and provides more information about the error.
var errorDescription: String? { get }
var failureReason: String? { get }
var helpAnchor: String? { get }
var recoverySuggestion: String? { get }
import Foundation
var localizedDescription: String { get }
Retrieve the localized description for this error.
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
protocol AbortError : Error
Errors conforming to this protocol will always be displayed by Vapor to the end-user (even in production mode where most errors are silenced).
var description: String { get }
See CustomStringConvertible
.
var identifier: String { get }
See AbortError.identifier
var reason: String { get }
See AbortError.reason
var status: HTTPResponseStatus { get }
See AbortError.status
var headers: HTTPHeaders { get }
See AbortError
.