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
constructor(errorCode: Int, errorMessage: String)

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

constructor(errorStatus: Int, errorCode: Int, errorMessage: String)

Create ErrorInfo from status, error code and corresponding message.

constructor(errorStatus: Int, errorCode: Int, errorMessage: String, errorDescription: String)

Create ErrorInfo from status, error code and corresponding message.

constructor(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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val status: Int = 0