RequestFailureReason

public enum RequestFailureReason

The underlying reason the request fails.

  • Server returns a non-successful status code.

    • 400: bad request e.g. invalid date format
    • 401: unauthorized
    • 404: resource not found
    • 500: internal error

    The server would also return a message field in the response’s JSON data.

    Declaration

    Swift

    case serverFailure(statusCode: Int, message: String)
  • Unknown response format returned by the server.

    Declaration

    Swift

    case unknownResponse
  • Failure due to network or any other error.

    Declaration

    Swift

    case failed(error: Error)