# Errors (/docs/sdks/rust/errors)



## Overview [#overview]

This guide explains how to handle errors returned by the Insion SDK and inspect response details when troubleshooting failed requests.

## Handle errors [#handle-errors]

All operations return `Result<T, ApiError>`.

```rust
match client.moderate_a_record(&request, None).await {
    Ok(result) => println!("{:?}", result.status),
    Err(ApiError::Http { status, message }) => eprintln!("{status}: {message}"),
    Err(ApiError::Network(error)) => eprintln!("network: {error}"),
    Err(error) => eprintln!("{error}"),
}
```

## Error variants [#error-variants]

Variants distinguish HTTP status failures, network/timeout failures, serialization, invalid URLs/headers, and client construction. Propagate errors with `?` unless the application can make a meaningful retry or user-facing decision.
