[twitter-dev] Re: Twitter Error codes/statements?

2010-05-30 Thread jaronbarends
Twitter also sends an error message in the response. These errors are
a quite descriptive, but afaik they're not fixed and could change in
the future. In my app I'm currently catching and handling a few of
these in a special way; with others I'm showing a general error
message. To be able to easily adopt my code to possible changes  to
Twitter's error messages, I have defined all errors as constants.
Below is the part of my php code, where I am defining the errors. The
second parameter in every define statement is the error message
Twitter is sending.

//401 Not authorized
define("TWITTER_ERROR_ACCESS_REVOKED", "Could not authenticate
you.");//user revoked app's access
define("TWITTER_ERROR_INCORRECT_SIGNATURE", "Incorrect signature");//
wrong oAuth tokens
define("TWITTER_ERROR_PROTECTED_USER", "Not authorized");
//403 Forbidden
define("TWITTER_ERROR_ALREADY_FAVORITED","You have already favorited
this status.");
//following is special case: it contains a username, so split it in
parts before and after username (full string: "Could not follow user:
[username] is already on your list.")
define("TWITTER_ERROR_ALREADY_FOLLOWING", "Already following");//use
this in code; function isError will check for _START and _END variants
define("TWITTER_ERROR_ALREADY_FOLLOWING_START", "Could not follow
user:");
define("TWITTER_ERROR_ALREADY_FOLLOWING_END", "is already on your
list.");
define("TWITTER_ERROR_DUPLICATE","Status is a duplicate.");
define("TWITTER_ERROR_NOT_FOLLOWING", "You are not friends with the
specified user.");
define("TWITTER_ERROR_RATE_LIMIT_EXCEEDED", "Rate limit exceeded.
Clients may not make more than 350 requests per hour.");//rate limit
exceede

On May 28, 5:03 pm, Michael Cameron  wrote:
> Yeah i have only seen a response , I would hope that we could
> get a tabularized list of those  responses. it would make
> debuging so much easier.
>
> On May 28, 1:53 am, wibblefish  wrote:
>
> > Only info I have found so far 
> > ishttp://apiwiki.twitter.com/HTTP-Response-Codes-and-Errors
>
> > On May 28, 1:02 am, Michael Cameron  wrote:
>
> > > So i am writing my catch expressions for twitter when parsing the
> > > response from twitter is there any error codes or definite strings for
> > > certain reasons. example "not following user", or other errors?
>
> > > Thank you!


[twitter-dev] Re: Twitter Error codes/statements?

2010-05-28 Thread Michael Cameron
Yeah i have only seen a response , I would hope that we could
get a tabularized list of those  responses. it would make
debuging so much easier.

On May 28, 1:53 am, wibblefish  wrote:
> Only info I have found so far 
> ishttp://apiwiki.twitter.com/HTTP-Response-Codes-and-Errors
>
> On May 28, 1:02 am, Michael Cameron  wrote:
>
> > So i am writing my catch expressions for twitter when parsing the
> > response from twitter is there any error codes or definite strings for
> > certain reasons. example "not following user", or other errors?
>
> > Thank you!


[twitter-dev] Re: Twitter Error codes/statements?

2010-05-28 Thread wibblefish
Only info I have found so far is 
http://apiwiki.twitter.com/HTTP-Response-Codes-and-Errors

On May 28, 1:02 am, Michael Cameron  wrote:
> So i am writing my catch expressions for twitter when parsing the
> response from twitter is there any error codes or definite strings for
> certain reasons. example "not following user", or other errors?
>
> Thank you!