DataServiceError
open class DataServiceError : DataError
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
status
holds 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) -> DataServiceError
Parameters
method
Name of method that is not implemented.
Return Value
a new exception with status 501 (Not Implemented).
-
Text describing
status
code.Declaration
Swift
open var statusText: String { get }
-
Declaration
Swift
open class func validationError(message: String) -> DataServiceError
Parameters
message
Validation 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?) -> DataServiceError
Parameters
cause
Root cause.
Return Value
A new exception with the specified root cause.
-
Declaration
Swift
open class func withCauseAndMessage(cause: Error?, message: String?) -> DataServiceError
Parameters
cause
Root cause.
message
Message text.
Return Value
A new exception with the specified root cause and message text.
-
Declaration
Swift
open class func withMessage(_ message: String?) -> DataServiceError
Parameters
message
Message text.
Return Value
A new exception with the specified message text.
-
Declaration
Swift
open class func withResponse(status: Int, message: String?, response: ErrorResponse?) -> DataServiceError
Parameters
status
Error code.
message
Message text.
response
Error 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) -> DataServiceError
Parameters
status
Error code.
message
Message text.
Return Value
A new exception with the specified error code and message text.