|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
twitter4j.TwitterException
public class TwitterException
An exception class that will be thrown when TwitterAPI calls are failed.
In case the Twitter server returned HTTP error code, you can get the HTTP status code using getStatusCode() method.
| Field Summary |
|---|
| Fields inherited from interface twitter4j.TwitterResponse |
|---|
NONE, READ, READ_WRITE, READ_WRITE_DIRECTMESSAGES |
| Fields inherited from interface twitter4j.internal.http.HttpResponseCode |
|---|
BAD_GATEWAY, BAD_REQUEST, ENHANCE_YOUR_CLAIM, FORBIDDEN, FOUND, INTERNAL_SERVER_ERROR, MULTIPLE_CHOICES, NOT_ACCEPTABLE, NOT_FOUND, NOT_MODIFIED, OK, SERVICE_UNAVAILABLE, TOO_LONG, UNAUTHORIZED |
| Constructor Summary | |
|---|---|
TwitterException(Exception cause)
|
|
TwitterException(String message)
|
|
TwitterException(String message,
Exception cause,
int statusCode)
|
|
TwitterException(String message,
twitter4j.internal.http.HttpResponse res)
|
|
TwitterException(String message,
Throwable cause)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
boolean |
exceededRateLimitation()
Tests if the exception is caused by rate limitation exceed |
int |
getAccessLevel()
|
String |
getErrorMessage()
Returns error message from the API if available. |
String |
getExceptionCode()
Returns a hexadecimal representation of this exception stacktrace. An exception code is a hexadecimal representation of the stacktrace which enables it easier to Google known issues. Format : XXXXXXXX:YYYYYYYY[ XX:YY] Where XX is a hash code of stacktrace without line number YY is a hash code of stacktrace excluding line number [-XX:YY] will appear when this instance a root cause |
RateLimitStatus |
getFeatureSpecificRateLimitStatus()
Returns the current feature-specific rate limit status if available. This method is available in conjunction with Twitter#searchUsers() |
String |
getMessage()
|
RateLimitStatus |
getRateLimitStatus()
Returns the current rate limit status if available. |
String |
getRequestPath()
Returns the request path returned by the API. |
String |
getResponseHeader(String name)
|
int |
getRetryAfter()
Returns int value of "Retry-After" response header (Search API) or seconds_until_reset (REST API). |
int |
getStatusCode()
|
int |
hashCode()
|
boolean |
isCausedByNetworkIssue()
Tests if the exception is caused by network issue |
boolean |
isErrorMessageAvailable()
Tests if error message from the API is available |
boolean |
resourceNotFound()
Tests if the exception is caused by non-existing resource |
String |
toString()
|
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TwitterException(String message,
Throwable cause)
public TwitterException(String message)
public TwitterException(Exception cause)
public TwitterException(String message,
twitter4j.internal.http.HttpResponse res)
public TwitterException(String message,
Exception cause,
int statusCode)
| Method Detail |
|---|
public String getMessage()
getMessage in class Throwablepublic int getStatusCode()
public String getResponseHeader(String name)
public RateLimitStatus getRateLimitStatus()
getRateLimitStatus in interface TwitterResponsepublic int getAccessLevel()
getAccessLevel in interface TwitterResponsepublic RateLimitStatus getFeatureSpecificRateLimitStatus()
public int getRetryAfter()
public boolean isCausedByNetworkIssue()
public boolean exceededRateLimitation()
public boolean resourceNotFound()
public String getExceptionCode()
public String getErrorMessage()
public String getRequestPath()
public boolean isErrorMessageAvailable()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||