Exceptions

HTTP requests returning an unsuccessful status code will raise:

All exceptions that the Ansys DCS clients explicitly raise inherit from ansys.dcs.client.DCSError.

exception ansys.dcs.client.DCSError(*args, **kwargs)

Base class for all ansys-dcs-client related errors. Derives from requests.exceptions.RequestException.

Example

>>> from ansys.dcs.client import DCSError
>>> from ansys.dcs.client.dps import Client
>>> try:
>>>     client = Client(dcs_url="https://127.0.0.1/dcs/", username="dcadmin",  password="wrong_psw")
>>> except DCSError as e:
>>>     print(e)
400 Client Error: invalid_grant for: POST https://127.0.0.1/dcs/auth/api/oauth/token
Invalid "username" or "password" in request.
exception ansys.dcs.client.APIError(*args, **kwargs)

Indicate server side related errors.

exception ansys.dcs.client.ClientError(*args, **kwargs)

Indicate client side related errors.