Handle errors
Catch API errors in Python and read exit codes in the CLI.
from onepin import OnepinClientfrom onepin.core.api_error import ApiErrorfrom onepin.errors import NotFoundError, ConflictError, UnprocessableEntityErrorclient = OnepinClient()try:wf = client.workflows.get(workflow_id="…").dataexcept NotFoundError:print("not found")except UnprocessableEntityError as e:print("invalid request:", e.body)except ApiError as e:print(f"API error {e.status_code}: {e.body}")