ErrorInfo

data class ErrorInfo(    val reason: ErrorReason = Unknown,     val status: Int = 0,     val code: Int = 0,     val message: String = "",     val description: String = "")

Representation of an Error object.

This object encapsulates information about an SDK error and is passed around to listener callbacks.

Parameters

reason

Error category as a ErrorReason.

status

Error category as a classifier. Local client errors get status 0, network related errors have their HTTP error code as a status.

code

Unique twilio code for this error. See also: Error and Warning Dictionary

message

Human readable description for the status property.

description

Human readable description for the code property.

Constructors

Link copied to clipboard
fun ErrorInfo(errorCode: Int, errorMessage: String)

Create ErrorInfo from error code and corresponding message. The status will be set to #CLIENT_ERROR.

Link copied to clipboard
fun ErrorInfo(    errorStatus: Int,     errorCode: Int,     errorMessage: String)

Create ErrorInfo from status, error code and corresponding message.

Link copied to clipboard
fun ErrorInfo(    errorStatus: Int,     errorCode: Int,     errorMessage: String,     errorDescription: String)

Create ErrorInfo from status, error code and corresponding message.

Link copied to clipboard
fun ErrorInfo(    reason: ErrorReason = Unknown,     status: Int = 0,     code: Int = 0,     message: String = "",     description: String = "")

Create ErrorInfo from reason, status, error code and corresponding message.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun toString(): String

Convert ErrorInfo to string representation, for example for logging.

Properties

Link copied to clipboard
val code: Int = 0
Link copied to clipboard
val description: String
Link copied to clipboard
val message: String
Link copied to clipboard
val reason: ErrorReason
Link copied to clipboard
val status: Int = 0