The ``exceptions.py`` module ============================ .. py:module:: ansys.hps.data_transfer.client.exceptions Summary ------- .. py:currentmodule:: exceptions .. tab-set:: .. tab-item:: Exceptions .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~HPSError` - Provides the base class for all HPS-related errors. * - :py:obj:`~APIError` - Provides server-side related errors. * - :py:obj:`~ClientError` - Provides client-side related errors. * - :py:obj:`~BinaryError` - Provides binary-related errors. * - :py:obj:`~NotReadyError` - Provides not ready-related errors. * - :py:obj:`~TimeoutError` - Provides timeout-related errors. .. tab-item:: Functions .. list-table:: :header-rows: 0 :widths: auto * - :py:obj:`~raise_for_status` - Automatically check for HTTP errors. * - :py:obj:`~async_raise_for_status` - Method for ``httpx.Response`` objects that checks HTTP errors. Description ----------- Provides the base class for all client and server HPS-related errors. .. !! processed by numpydoc !! Module detail ------------- .. py:exception:: HPSError(*args, **kwargs) Provides the base class for all HPS-related errors. This class derives from the :class:`requests.exceptions.RequestException` base class. Example: >>> from ansys.hps.client import HPSError >>> from ansys.hps.client.jms import Client >>> try: >>> client = Client(url="https://127.0.0.1:8443/hps/", username="repuser", password="wrong_psw") >>> except HPSError as e: >>> print(e) 401 Client Error: invalid_grant for: POST https://127.0.0.1:8443/hps/auth... Invalid user credentials .. !! processed by numpydoc !! .. py:currentmodule:: HPSError Overview -------- .. tab-set:: .. tab-item:: Attributes .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~reason` - * - :py:attr:`~description` - * - :py:attr:`~give_up` - Import detail ------------- .. code-block:: python from ansys.hps.data_transfer.client.exceptions import HPSError Attribute detail ---------------- .. py:attribute:: reason .. py:attribute:: description .. py:attribute:: give_up .. py:exception:: APIError(*args, **kwargs) Provides server-side related errors. .. !! processed by numpydoc !! Import detail ------------- .. code-block:: python from ansys.hps.data_transfer.client.exceptions import APIError .. py:exception:: ClientError(*args, **kwargs) Provides client-side related errors. .. !! processed by numpydoc !! Import detail ------------- .. code-block:: python from ansys.hps.data_transfer.client.exceptions import ClientError .. py:exception:: BinaryError(*args, **kwargs) Provides binary-related errors. .. !! processed by numpydoc !! Import detail ------------- .. code-block:: python from ansys.hps.data_transfer.client.exceptions import BinaryError .. py:exception:: NotReadyError(*args, **kwargs) Provides not ready-related errors. .. !! processed by numpydoc !! Import detail ------------- .. code-block:: python from ansys.hps.data_transfer.client.exceptions import NotReadyError .. py:exception:: TimeoutError(*args, **kwargs) Provides timeout-related errors. .. !! processed by numpydoc !! Import detail ------------- .. code-block:: python from ansys.hps.data_transfer.client.exceptions import TimeoutError .. py:function:: raise_for_status(response: httpx.Response) Automatically check for HTTP errors. This method mimics the ``requests.Response.raise_for_status()`` method. .. !! processed by numpydoc !! .. py:function:: async_raise_for_status(response: httpx.Response) :async: Method for ``httpx.Response`` objects that checks HTTP errors. .. !! processed by numpydoc !!