DecodingError
An error that occurs during the decoding of a value.
enum DecodingError
Citizens in Swift
Conformances
protocol Error
A type representing an error value that can be thrown.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Members
case dataCorrupted(DecodingError.Context)
An indication that the data is corrupted or otherwise invalid.
case keyNotFound(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.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.Type, DecodingError.Context)
An indication that a non-optional value of the given type was expected, but a null value was found.
static func dataCorruptedError<C>(forKey: C.Key, in: C, debugDescription: String
) -> DecodingError Returns a new
.dataCorrupted
error using a constructed coding path and the given debug description.static func dataCorruptedError(in: SingleValueDecodingContainer, debugDescription: String
) -> DecodingError Returns a new
.dataCorrupted
error using a constructed coding path and the given debug description.static func dataCorruptedError(in: 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.
Available in Foundation
Conformances
protocol LocalizedError
Describes an error that provides localized messages describing why an error occurred and provides more information about the error.
Extension in Vapor
Conformances
protocol AbortError
Errors conforming to this protocol will always be displayed by Vapor to the end-user (even in production mode where most errors are silenced).
Members
var description: String
See
CustomStringConvertible
.var identifier: String
See
AbortError.identifier
var reason: String
See
AbortError.reason
var status: HTTPResponseStatus
See
AbortError.status