public class

NexmoAPIError

extends Exception
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ com.nexmo.sdk.conversation.client.event.NexmoAPIError

Class Overview

Nexmo API exception that can be caught and handled, encapsulates following information:

    • rid: Optional request id for which the error occurred, null if the request was pre-validated client side.
      type: The error type as received from server, for ex: `text:error-not-joined`
      cid: Optional conversation id associated with the request.
      message: human readable description of the exception. If not present, only type will be used.
      stacktrace: class, method name and line number where exception was thrown.
  • Summary

    Constants
    String AUDIO_ALREADY_IN_PROGRESS
    String AUDIO_GENERAL_CALL_ERROR
    String AUDIO_MISSING_PERMISSIONS
    String CONNECT_ALREADY_IN_PROGRESS
    String DOWNLOAD_FAILURE
    String IMAGE_DELETE_FAILURE
    String INVALID_ACTION
    String INVALID_PARAMS
    String MISSING_PARAMS
    String NO_USER Local error type due to pre-validations.
    String PERMISSION_REQUIRED
    String UNEXPECTED_RESPONSE
    String UPLOAD_FAILURE
    String USER_ALREADY_LOGGED_IN
    Fields
    public static final String TAG
    Public Constructors
    NexmoAPIError(String type, String message)
    NexmoAPIError(String type, String conversationId, String message)
    NexmoAPIError(String rid, String type, String conversationId, String message)
    Public Methods
    static NexmoAPIError alreadyConnecting()
    static NexmoAPIError audioAlreadyInProgress()
    static NexmoAPIError audioGeneralCallError(String description)
    static NexmoAPIError audioMissingPermissions()
    static NexmoAPIError downloadFailure(String conversationId)
    Image event failures
    boolean equals(Object o)
    static void forward(RequestHandler listener, NexmoAPIError error)
    String getConversationId()
    Returns the conversation id associated with the request.
    String getRid()
    Returns the request Id for which the error was triggered.
    String getType()
    Returns the type of error.
    int hashCode()
    static NexmoAPIError invalidAction(String conversationId, String message)
    static NexmoAPIError missingParams()
    static NexmoAPIError noUserLoggedIn()
    Predefined local errors.
    static NexmoAPIError noUserLoggedInForConversation(String conversationId)
    static NexmoAPIError onUserAlreadyLoggedIn()
    static NexmoAPIError permissionRequired(String conversationId)
    String toString()
    static NexmoAPIError unexpectedResponse(String rid, String conversationId)
    commonly used when received data cannot be parsed.
    [Expand]
    Inherited Methods
    From class java.lang.Throwable
    From class java.lang.Object

    Constants

    public static final String AUDIO_ALREADY_IN_PROGRESS

    Constant Value: "audio:already-connecting"

    public static final String AUDIO_GENERAL_CALL_ERROR

    Constant Value: "audio:general-error"

    public static final String AUDIO_MISSING_PERMISSIONS

    Constant Value: "audio:missing-permissions"

    public static final String CONNECT_ALREADY_IN_PROGRESS

    Constant Value: "login:already-connecting"

    public static final String DOWNLOAD_FAILURE

    Constant Value: "image:download-failure"

    public static final String IMAGE_DELETE_FAILURE

    Constant Value: "image:delete-failure"

    public static final String INVALID_ACTION

    Constant Value: "invalid-action"

    public static final String INVALID_PARAMS

    Constant Value: "invalid-params"

    public static final String MISSING_PARAMS

    Constant Value: "missing-params"

    public static final String NO_USER

    Local error type due to pre-validations.

    Constant Value: "user:invalid"

    public static final String PERMISSION_REQUIRED

    Constant Value: "permission:error"

    public static final String UNEXPECTED_RESPONSE

    Constant Value: "unexpected-response"

    public static final String UPLOAD_FAILURE

    Constant Value: "image:upload-failure"

    public static final String USER_ALREADY_LOGGED_IN

    Constant Value: "login:user-already-loggedin"

    Fields

    public static final String TAG

    Public Constructors

    public NexmoAPIError (String type, String message)

    public NexmoAPIError (String type, String conversationId, String message)

    public NexmoAPIError (String rid, String type, String conversationId, String message)

    Public Methods

    public static NexmoAPIError alreadyConnecting ()

    public static NexmoAPIError audioAlreadyInProgress ()

    public static NexmoAPIError audioGeneralCallError (String description)

    public static NexmoAPIError audioMissingPermissions ()

    public static NexmoAPIError downloadFailure (String conversationId)

    Image event failures

    public boolean equals (Object o)

    public static void forward (RequestHandler listener, NexmoAPIError error)

    public String getConversationId ()

    Returns the conversation id associated with the request.

    Returns
    • The conversation id or null if request was not related to any conversation.

    public String getRid ()

    Returns the request Id for which the error was triggered.

    Returns
    • Request id or null of request was pre-validated on the client.

    public String getType ()

    Returns the type of error.

    Returns
    • String describing the error category.

    public int hashCode ()

    public static NexmoAPIError invalidAction (String conversationId, String message)

    public static NexmoAPIError missingParams ()

    public static NexmoAPIError noUserLoggedIn ()

    Predefined local errors. Local errors will never have a rid because they never reach the network.

    public static NexmoAPIError noUserLoggedInForConversation (String conversationId)

    public static NexmoAPIError onUserAlreadyLoggedIn ()

    public static NexmoAPIError permissionRequired (String conversationId)

    public String toString ()

    public static NexmoAPIError unexpectedResponse (String rid, String conversationId)

    commonly used when received data cannot be parsed.