public class TwitterException
extends java.lang.RuntimeException
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.
Modifier and Type | Class and Description |
---|---|
static class |
TwitterException.AccessLevel
Subclass of 403 thrown when you breach the access level of the app /
oauth-token.
|
static class |
TwitterException.AgeScreen
For when Twitter sends a code 250 "this account is age-locked and the user hasn't given their age" response.
|
static class |
TwitterException.BadParameter
Exception thrown when Twitter doesn't like a parameter.
|
static class |
TwitterException.Blocked
Exception thrown when trying to follow an account that has blocked you.
|
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.E406
Not Acceptable.
|
static class |
TwitterException.E40X
A user-error.
|
static class |
TwitterException.E413
Too Long.
|
static class |
TwitterException.E416
Range Unacceptable.
|
static class |
TwitterException.E50X
A code 50X error (e.g.
|
static class |
TwitterException.FollowerLimit
Subclass of 403 thrown when you follow too many people.
|
static class |
TwitterException.IO
An IO exception, eg.
|
static class |
TwitterException.MissingUser
This might be a suspended account, a deleted account, or a renamed account.
|
static class |
TwitterException.Parsing
Problems reading the JSON returned by Twitter.
|
static class |
TwitterException.PreEmptiveRateLimit
A rate limit error (i.e.
|
static class |
TwitterException.RateLimit
Indicates a rate limit error (i.e.
|
static class |
TwitterException.Repetition
Subclass of 403 thrown when you try to do something twice, like post the
same status.
|
static class |
TwitterException.SuspendedProfile
Exception thrown when trying to USE a suspended account.
|
static class |
TwitterException.SuspendedUser
Exception thrown when trying to QUERY a suspended account (i.e.
|
static class |
TwitterException.Timeout
A timeout exception - probably caused by Twitter being overloaded.
|
static class |
TwitterException.TooManyLogins
A code 420 error indicates that the account has been logging in too
often.
|
static class |
TwitterException.TooRecent
Thrown if you poll too frequently.
|
static class |
TwitterException.TooSpammy
For when Twitter sends a code 226 "this looks like auto junk" response.
|
static class |
TwitterException.TwitLongerException
Exception thrown if something goes wrong with twilonger.com integration
for long tweets.
|
static class |
TwitterException.Unexplained
Something has gone wrong.
|
static class |
TwitterException.UpdateToOAuth
Legacy exception thrown when trying to use basic auth instead of oauth.
|
static class |
TwitterException.UploadTooBig
A video upload was too big or too long.
|
static class |
TwitterException.UserNotFound
This is very similar to a
TwitterException.MissingUser . |
Constructor and Description |
---|
TwitterException(java.lang.String string) |
TwitterException(java.lang.String string,
java.lang.String additionalInfo) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAdditionalInfo() |
void |
setAdditionalInfo(java.lang.String additionalInfo) |