|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
winterwell.jtwitter.TwitterException
public class TwitterException
A runtime exception for when Twitter requests don't work. All Twitter methods can throw this.
This contains several subclasses which should be thrown to mark different problems. Error handling is particularly important as Twitter tends to be a bit flaky.
I believe unchecked exceptions are preferable to checked ones, because they avoid the problems caused by swallowing exceptions. But if you don't like runtime exceptions, just edit this class.
| Nested Class Summary | |
|---|---|
static class |
TwitterException.E401
An unauthorised exception. |
static class |
TwitterException.E403
A Forbidden exception. |
static class |
TwitterException.E404
Indicates a 404: resource does not exist error from Twitter. |
static class |
TwitterException.E50X
A code 50X error (e.g. 502) - indicating something went wrong at Twitter's end. |
static class |
TwitterException.RateLimit
Indicates a rate limit error (i.e. you've over-used Twitter) |
static class |
TwitterException.Timeout
A timeout exception - probably caused by Twitter being overloaded. |
static class |
TwitterException.Unexplained
Something has gone wrong. |
| Constructor Summary | |
|---|---|
TwitterException(java.lang.String string)
|
|
TwitterException(java.lang.String string,
java.lang.String additionalInfo)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getAdditionalInfo()
|
void |
setAdditionalInfo(java.lang.String additionalInfo)
|
| 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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TwitterException(java.lang.String string)
string -
public TwitterException(java.lang.String string,
java.lang.String additionalInfo)
| Method Detail |
|---|
public java.lang.String getAdditionalInfo()
public void setAdditionalInfo(java.lang.String additionalInfo)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||