DataTransactionError
public enum DataTransactionError: Error
An ErrorType
that represents various errors that can occur when executing
DataTransaction
s.
-
A
DataTransactionError
that wraps a genericErrorType
.Declaration
Swift
case wrappedError(Error)
-
Contains an error message returned by a service.
Declaration
Swift
case serviceError(String)
-
An error indicating that data is not in the expected format. Contains a message with additional details.
Declaration
Swift
case dataFormatError(String)
-
An error indicating that JSON data is not in the expected format. Contains a message with additional details, as well as an optional object instance containing the source data of the JSON.
Declaration
Swift
case jsonFormatError(String, Any?)
-
The execution path taken by a
DataTransaction
has not been fully implemented.Declaration
Swift
case notImplemented
-
The resource requested by the
DataTransaction
is not available.Declaration
Swift
case notAvailable
-
The transaction protocol has been implemented incorrectly.
Declaration
Swift
case badImplementation
-
Transaction processing encountered an unexpected type.
Declaration
Swift
case incompatibleType
-
Failed to create a
URLSessionTask
for the transaction.Declaration
Swift
case sessionTaskNotCreated
-
Use of the HTTP protocol is required for the given transaction, but it was not used.
Declaration
Swift
case httpRequired
-
The transaction could not be initiated because the request has no
URL
.Declaration
Swift
case noURL
-
The transaction returned no data.
Declaration
Swift
case noData
-
The transaction was canceled or deallocated before it could be completed.
Declaration
Swift
case canceled
-
The transaction is already in the process of being executed and has not yet returned.
Declaration
Swift
case alreadyInFlight
-
The transaction was aborted because it did not complete in a reasonable time.
Declaration
Swift
case timeout
-
The transaction expired before it completed.
Declaration
Swift
case expired
-
The given string could not be converted into a
URL
instance.Declaration
Swift
case invalidURL(String)
-
An unexpected HTTP response code was returned for the transaction.
Declaration
Swift
case unexpectedHTTPResponseCode(Int)
-
Indicates that the caller is not authorized to perform the given transaction.
Declaration
Swift
case notAuthorized
-
Indicates an HTTP error response was received. Contains the response, its metadata, and the body of the response.
Declaration
Swift
case httpError(HTTPURLResponse, HTTPResponseMetadata, Data)
-
Returns a
DataTransactionError
representing the givenErrorType
.Declaration
Swift
public static func wrap(_ error: Error) -> DataTransactionError
Parameters
error
The
ErrorType
to (possibly) wrap. Iferror
is already aDataTransactionError
, it is simply returned as-is. Otherwise,.WrappedError(error)
is returned.
-
A string representation of the
DataTransactionError
.Declaration
Swift
public var description: String