[twitter-dev] API errors with Python Tools

2010-04-15 Thread Andrei Boutyline
Hey all,

I've been using the Python Twitter Tools library to access the API,
which is beautiful and great to use but as far as I can tell has no
systematic error handling.  There is no distinction between temporary
errors (e.g., connection failed, rate limit exceeded, etc) and
permanent ones (e.g, user account deleted).  Furthermore, library
itself doesn't even return the error code--just a chunk of unparsed
HTML that it gets from Twitter.  So, it pretty much means that error
handling is a roll-your-own kind of issue.  Have any of you found good
ways of dealing with this problem?  Do other Twitter libraries provide
better error handling?  (Hopefully other Python libraries do this
better, but I would be willing to switch languages if necessary).

Thanks in advance,
Andrei


-- 
Subscription settings: 
http://groups.google.com/group/twitter-development-talk/subscribe?hl=en


Re: [twitter-dev] API errors with Python Tools

2010-04-16 Thread Josh Roesslein
You might also consider looking into Tweepy [1]. It is a library I have
written and released open source.
The way I handle errors is I parse the message Twitter sends and then throw
an exception.
You can then catch it and extract that message.
If you have any trouble at all we have both a mailing list and IRC chat. So
feel free to ask there
and hopefully we can lead you in the right direction.

Josh

[1] http://github.com/joshthecoder/tweepy

On Thu, Apr 15, 2010 at 4:08 PM, Andrei Boutyline <
andrei.boutyl...@gmail.com> wrote:

> Hey all,
>
> I've been using the Python Twitter Tools library to access the API,
> which is beautiful and great to use but as far as I can tell has no
> systematic error handling.  There is no distinction between temporary
> errors (e.g., connection failed, rate limit exceeded, etc) and
> permanent ones (e.g, user account deleted).  Furthermore, library
> itself doesn't even return the error code--just a chunk of unparsed
> HTML that it gets from Twitter.  So, it pretty much means that error
> handling is a roll-your-own kind of issue.  Have any of you found good
> ways of dealing with this problem?  Do other Twitter libraries provide
> better error handling?  (Hopefully other Python libraries do this
> better, but I would be willing to switch languages if necessary).
>
> Thanks in advance,
> Andrei
>
>
> --
> Subscription settings:
> http://groups.google.com/group/twitter-development-talk/subscribe?hl=en
>