Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
a439c3d9
Commit
a439c3d9
authored
Oct 15, 2015
by
obskyr
Browse files
Added documentation for exceptions.
parent
954b2f48
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/api.rst
View file @
a439c3d9
...
...
@@ -777,3 +777,29 @@ Geo Methods
Given *id* of a place, provide more details about that place.
:param id: Valid Twitter ID of a location.
:mod:`tweepy.error` --- Exceptions
==================================
The exceptions are available in the ``tweepy`` module directly,
which means ``tweepy.error`` itself does not need to be imported. For
example, ``tweepy.error.TweepError`` is available as ``tweepy.TweepError``.
.. exception:: TweepError
The main exception Tweepy uses. Is raised for a number of things.
When a ``TweepError`` is raised due to an error Twitter responded with,
the error code (`as described in the API documentation
<https://dev.twitter.com/overview/api/response-codes>`_) can be accessed
at ``TweepError.message[0]['code']``. Note, however, that ``TweepError``\ s
also may be raised with other things as message (for example plain
error reason strings).
.. exception:: RateLimitError
Is raised when an API method fails due to hitting Twitter's rate
limit. Makes for easy handling of the rate limit specifically.
Inherits from :exc:`TweepError`, so ``except TweepError`` will
catch a ``RateLimitError`` too.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment