from chatatp_studio import (
ChatATPClient,
AuthenticationError,
NotFoundError,
RateLimitError,
ValidationError,
ServerError,
NetworkError,
)
client = ChatATPClient(api_key="chatatp_sk_...")
try:
agent = await client.agents.retrieve(999)
except AuthenticationError:
print("Check your API key.")
except NotFoundError:
print("Agent not found.")
except RateLimitError:
print("Slow down — you've hit the rate limit.")
except ValidationError as e:
print("Bad request:", e.payload)
except ServerError:
print("ChatATP server error, try again shortly.")
except NetworkError as e:
print("Network failure:", e)