Skip to content

Error Handling

Benmebrouk edited this page Apr 12, 2026 · 1 revision

Error Handling

from wauldo import WauldoError, ServerError, ValidationError

try:
    result = client.guard(text="test", source_context="test")
except ServerError as e:
    print(f"Server error [{e.code}]: {e}")
except ValidationError as e:
    print(f"Invalid input: {e}")
except WauldoError as e:
    print(f"Error: {e}")
Code Meaning Action
400 Bad request Check parameters
401 Unauthorized Check API key
429 Rate limited Wait and retry
500 Server error Retry

The SDK retries transient errors (429, 5xx) with exponential backoff.

Clone this wiki locally