com.pubnub.api.PubNubException.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-kotlin Show documentation
Show all versions of pubnub-kotlin Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of
broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter
second!
package com.pubnub.api
import retrofit2.Call
/**
* Custom exception wrapper for errors occurred during execution or processing of a PubNub API operation.
*
* @property errorMessage The error message received from the server, if any.
* @property pubnubError The appropriate matching PubNub error.
* @property jso The error json received from the server, if any.
* @property statusCode HTTP status code.
* @property affectedCall A reference to the affected call. Useful for calling [retry][Endpoint.retry].
*/
data class PubNubException(
val errorMessage: String? = null,
val pubnubError: PubNubError? = null,
val jso: String? = null,
val statusCode: Int = 0,
val affectedCall: Call<*>? = null
) : Exception(errorMessage) {
internal constructor(pubnubError: PubNubError) : this(
errorMessage = pubnubError.message,
pubnubError = pubnubError
)
}