Skip to content

Error Handling

Benmebrouk edited this page Apr 12, 2026 · 1 revision

Error Handling

use wauldo::Error;

match client.guard("test", "test", None).await {
    Ok(r) => println!("{}", r.verdict),
    Err(Error::Server { code, message, .. }) => eprintln!("[{code}]: {message}"),
    Err(Error::Connection(msg)) => eprintln!("Connection: {msg}"),
    Err(Error::Timeout(msg)) => eprintln!("Timeout: {msg}"),
    Err(e) => eprintln!("{e}"),
}

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

Clone this wiki locally