DataServiceError
open class DataServiceError : DataError, @unchecked Sendable
Exception thrown when a DataService request fails due to a data service issue.
-
If the data service request failed with an HTTP error code, then
statusholds the error code. Otherwise zero.Declaration
Swift
final public var status: Int -
If the data service request returned on OData error response, then this holds the parsed error response. Otherwise
nil.Declaration
Swift
final public var response: ErrorResponse? -
Default initializer.
Declaration
Swift
override public init() -
Declaration
Swift
open class func notImplemented(method: String) -> DataServiceErrorParameters
methodName of method that is not implemented.
Return Value
a new exception with status 501 (Not Implemented).
-
Text describing
statuscode.Declaration
Swift
open var statusText: String { get } -
Declaration
Swift
open class func validationError(message: String) -> DataServiceErrorParameters
messageValidation error message to be received by the client.
Return Value
a new exception with status 400 (Client Error) for a data validation error.
-
Declaration
Swift
open class func withCause(_ cause: Error?) -> DataServiceErrorParameters
causeRoot cause.
Return Value
A new exception with the specified root cause.
-
Declaration
Swift
open class func withCauseAndMessage(cause: Error?, message: String?) -> DataServiceErrorParameters
causeRoot cause.
messageMessage text.
Return Value
A new exception with the specified root cause and message text.
-
Declaration
Swift
open class func withMessage(_ message: String?) -> DataServiceErrorParameters
messageMessage text.
Return Value
A new exception with the specified message text.
-
Declaration
Swift
open class func withResponse(status: Int, message: String?, response: ErrorResponse?) -> DataServiceErrorParameters
statusError code.
messageMessage text.
responseError response.
Return Value
A new exception with the specified error code, message text and error response.
-
Declaration
Swift
open class func withStatus(_ status: Int, message: String? = nil) -> DataServiceErrorParameters
statusError code.
messageMessage text.
Return Value
A new exception with the specified error code and message text.