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 = (0 as 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 var statusText: String
  • 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.