from vrin import (
VRINClient,
AuthenticationError,
RateLimitError,
ServiceUnavailableError,
TimeoutError,
VRINError,
)
try:
result = client.query("What is ACME's revenue?")
except AuthenticationError:
# API key is invalid or expired -- cannot retry
print("Check your API key")
except RateLimitError:
# Back off and retry
print("Rate limited -- wait before retrying")
except ServiceUnavailableError:
# Server error -- the client already retried (max_retries times)
print("Service temporarily unavailable")
except TimeoutError:
# Request took too long
print("Request timed out")
except VRINError as e:
# Catch-all for any other Vrin error
print(f"Unexpected error: {e}")