--------------------
Twitter exceptions inherit from HTTP exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The name of the exceptions related to the HTTP status of the response are now
prefixed with ``HTTP``.
Here is a list of those new exceptions:
* :class:`~peony.exceptions.HTTPNotModified`
* :class:`~peony.exceptions.HTTPBadRequest`
* :class:`~peony.exceptions.HTTPUnauthorized`
* :class:`~peony.exceptions.HTTPForbidden`
* :class:`~peony.exceptions.HTTPNotFound`
* :class:`~peony.exceptions.HTTPNotAcceptable`
* :class:`~peony.exceptions.HTTPConflict`
* :class:`~peony.exceptions.HTTPGone`
* :class:`~peony.exceptions.HTTPEnhanceYourCalm`
* :class:`~peony.exceptions.HTTPUnprocessableEntity`
* :class:`~peony.exceptions.HTTPTooManyRequests`
* :class:`~peony.exceptions.HTTPInternalServerError`
* :class:`~peony.exceptions.HTTPBadGateway`
* :class:`~peony.exceptions.HTTPServiceUnavailable`
* :class:`~peony.exceptions.HTTPGatewayTimeout`
The exceptions related to twitter error codes now inherit from those
exceptions, this means that the order of execution of your ``except`` blocks
now matter. The "HTTP" exceptions should be handled after the exceptions
related to twitter error codes.
This works as expected:
.. code-block:: python
except ReadOnlyApplication:
...
except HTTPForbidden:
...
Here, :class:`~peony.exceptions.ReadOnlyApplication` will be caught by the first ``except`` block instead of the more specific ``except ReadOnlyApplication``.
.. code-block:: python
except HTTPForbidden:
...
except ReadOnlyApplication:
...
:class:`~peony.client.PeonyClient` doesn't have a ``twitter_configuration`` attribute anymore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`Twitter removed the endpoint used to set this attribute's value
<https://twittercommunity.com/t/retiring-the-1-1-configuration-endpoint/153319>`_,
because they never really changed. So you can use constants instead of using
the values from this attribute.
`Here is an exemple of what this endpoint used to return in case you need it.
<https://hikari.butaishoujo.moe/b/f97a8847/twitter_configuration.json>`_
--------------------