> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polynode.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust Errors

> Handle structured V3, WebSocket, trading, reconnect, and PN1 integrity failures in Rust.

```rust theme={null}
use polynode::Error;

match client.v3()
    .execute_named("GET /v3/stats", Default::default())
    .await
{
    Ok(value) => println!("{value:#}"),
    Err(Error::V3Api(error)) => {
        eprintln!("status={} code={:?}", error.status, error.code);
        eprintln!("request_id={:?} retry_after={:?}",
            error.request_id, error.retry_after);
        eprintln!("{} {}", error.safe_method, error.safe_url);
    }
    Err(error) => return Err(error),
}
```

Safe V3 reads retry transient failures and retryable statuses. State-changing calls are never retried automatically. After a mutation timeout, verify current state before submitting it again.

WebSocket delivery signals arrive as typed messages:

* `WsMessage::Replay` reports best-effort settlement replay;
* `PerpsMessage::Reconnected` reports a possible perps gap;
* `PerpsMessage::LagWarning` reports upstream lag;
* the event and perps receive channels are bounded and apply backpressure;
* `engine.integrity_errors()` reports PN1 failures and the affected token remains gated until a fresh anchor succeeds.

Log request IDs and redacted safe URLs, never API keys, private keys, CLOB secrets, builder credentials, or signed payloads.
