Chat Android SDK  7.0.1
com.twilio.chat.ErrorInfo Class Reference

Representation of a Chat Error object. More...

Public Member Functions

 ErrorInfo (int errorCode, String errorMessage)
 Create ErrorInfo from error code and corresponding message. More...
 
 ErrorInfo (int errorStatus, int errorCode, String errorMessage)
 Create ErrorInfo from status, error code and corresponding message. More...
 
int getStatus ()
 Get error category as a classifier. More...
 
int getCode ()
 Returns unique code for this error. More...
 
String getMessage ()
 Returns error message of this error. More...
 
String toString ()
 Convert ErrorInfo to string representation, for example for logging. More...
 

Static Public Attributes

static int CLIENT_ERROR = 0
 This status is set if error occured in the SDK and is not related to network operations.
 
static int CANNOT_GET_MESSAGE_BY_INDEX = -4
 This code is signaled to the listener of Messages::getMessageByIndex() if general error occurs and message could not be retrieved.
 
static int MISMATCHING_TOKEN_UPDATE = -5
 This code is signaled to the listener of ChatClient::updateToken() if updated token does not match the original token. More...
 
static int CHANNEL_NOT_SYNCHRONIZED = -6
 This code is signaled when an attempt is made to query channel members or messages without synchronizing first.
 

Detailed Description

Representation of a Chat Error object.

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

Constructor & Destructor Documentation

com.twilio.chat.ErrorInfo.ErrorInfo ( int  errorCode,
String  errorMessage 
)

Create ErrorInfo from error code and corresponding message.

The status will be set to CLIENT_ERROR.

Parameters
errorCodeError code.
errorMessageError description.
com.twilio.chat.ErrorInfo.ErrorInfo ( int  errorStatus,
int  errorCode,
String  errorMessage 
)

Create ErrorInfo from status, error code and corresponding message.

Parameters
errorStatusError status code.
errorCodeError unique code.
errorMessageError description.

Member Function Documentation

int com.twilio.chat.ErrorInfo.getCode ( )

Returns unique code for this error.

Returns
Unique code for the error.
String com.twilio.chat.ErrorInfo.getMessage ( )

Returns error message of this error.

Returns
Error message of the error.
int com.twilio.chat.ErrorInfo.getStatus ( )

Get error category as a classifier.

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

Returns
Error status.
String com.twilio.chat.ErrorInfo.toString ( )

Convert ErrorInfo to string representation, for example for logging.

Returns
String representation of ErrorInfo object.

Member Data Documentation

int com.twilio.chat.ErrorInfo.MISMATCHING_TOKEN_UPDATE = -5
static

This code is signaled to the listener of ChatClient::updateToken() if updated token does not match the original token.

This error often indicates that you have updated token with a different identity, which is not allowed - you cannot change client identity mid-flight.

If this error is returned, you should shutdown and re-create ChatClient.