|
|||||||||
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 | |
---|---|
private RateLimitStatus |
featureSpecificRateLimitStatus
|
private static java.lang.String[] |
FILTER
|
(package private) boolean |
nested
|
private RateLimitStatus |
rateLimitStatus
|
private int |
retryAfter
|
private static long |
serialVersionUID
|
private int |
statusCode
|
Fields inherited from interface twitter4j.internal.http.HttpResponseCode |
---|
BAD_GATEWAY, BAD_REQUEST, ENHANCE_YOUR_CLAIM, FORBIDDEN, INTERNAL_SERVER_ERROR, MULTIPLE_CHOICES, NOT_ACCEPTABLE, NOT_FOUND, NOT_MODIFIED, OK, SERVICE_UNAVAILABLE, UNAUTHORIZED |
Constructor Summary | |
---|---|
TwitterException(java.lang.Exception cause)
|
|
TwitterException(java.lang.String msg)
|
|
TwitterException(java.lang.String msg,
java.lang.Exception cause)
|
|
TwitterException(java.lang.String msg,
java.lang.Exception cause,
int statusCode)
|
|
TwitterException(java.lang.String msg,
twitter4j.internal.http.HttpResponse res)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
boolean |
exceededRateLimitation()
Tests if the exception is caused by rate limitation exceed |
private static java.lang.String |
getCause(twitter4j.internal.http.HttpResponse res)
|
java.lang.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() |
RateLimitStatus |
getRateLimitStatus()
Returns the current rate limit status if available. |
int |
getRetryAfter()
Returns int value of "Retry-After" response header. |
int |
getStatusCode()
|
int |
hashCode()
|
boolean |
isCausedByNetworkIssue()
Tests if the exception is caused by network issue |
boolean |
resourceNotFound()
Tests if the exception is caused by non-existing resource |
(package private) void |
setNested()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int statusCode
private int retryAfter
private RateLimitStatus rateLimitStatus
private RateLimitStatus featureSpecificRateLimitStatus
private static final long serialVersionUID
private static final java.lang.String[] FILTER
boolean nested
Constructor Detail |
---|
public TwitterException(java.lang.String msg)
public TwitterException(java.lang.Exception cause)
public TwitterException(java.lang.String msg, twitter4j.internal.http.HttpResponse res)
public TwitterException(java.lang.String msg, java.lang.Exception cause)
public TwitterException(java.lang.String msg, java.lang.Exception cause, int statusCode)
Method Detail |
---|
public int getStatusCode()
public RateLimitStatus getRateLimitStatus()
getRateLimitStatus
in interface TwitterResponse
public RateLimitStatus getFeatureSpecificRateLimitStatus()
public int getRetryAfter()
public boolean isCausedByNetworkIssue()
public boolean exceededRateLimitation()
public boolean resourceNotFound()
public java.lang.String getExceptionCode()
void setNested()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Throwable
private static java.lang.String getCause(twitter4j.internal.http.HttpResponse res)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |