com.twilio.sdk
Class TwilioRestException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.twilio.sdk.TwilioRestException
All Implemented Interfaces:
Serializable

public class TwilioRestException
extends Exception

See: https://www.twilio.com/docs/errors/ for more info

Author:
FrankStratton
See Also:
Serialized Form

Constructor Summary
TwilioRestException(String message, int errorCode)
          Instantiates a new twilio rest exception.
TwilioRestException(String message, int errorCode, String moreInfo)
          Instantiates a new twilio rest exception.
 
Method Summary
 int getErrorCode()
          Gets the error code.
 String getErrorMessage()
          Gets the error message.
 String getMoreInfo()
          Gets the more info.
static TwilioRestException parseResponse(TwilioRestResponse response)
          Parses the response.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TwilioRestException

public TwilioRestException(String message,
                           int errorCode)
Instantiates a new twilio rest exception.

Parameters:
message - the message
errorCode - the error code

TwilioRestException

public TwilioRestException(String message,
                           int errorCode,
                           String moreInfo)
Instantiates a new twilio rest exception.

Parameters:
message - the message
errorCode - the error code
moreInfo - the more info
Method Detail

parseResponse

public static TwilioRestException parseResponse(TwilioRestResponse response)
Parses the response.

Parameters:
response - the response
Returns:
the twilio rest exception

getErrorCode

public int getErrorCode()
Gets the error code.

Returns:
the error code

getErrorMessage

public String getErrorMessage()
Gets the error message.

Returns:
the error message

getMoreInfo

public String getMoreInfo()
Gets the more info.

Returns:
the more info


Copyright © 2011 Twilio, Inc. All Rights Reserved.