# handle_sandbox_http_error

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/sandbox/_helpers/handle_sandbox_http_error)

Handle HTTP errors for sandbox operations (run, read, write).

Maps API error types to specific exceptions:
- WriteError -> SandboxOperationError (operation="write")
- ReadError -> SandboxOperationError (operation="read")
- CommandError -> SandboxOperationError (operation="command")
- ConnectionError (502) -> SandboxConnectionError
- FileNotFound / 404 -> ResourceNotFoundError (resource_type="file")
- NotReady (400) -> SandboxNotReadyError
- 403 -> SandboxOperationError (permission denied)

## Signature

```python
handle_sandbox_http_error(
    error: httpx.HTTPStatusError,
) -> None
```

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/2baf5f1092ca631657cb37e0db432295daea9f2e/python/langsmith/sandbox/_helpers.py#L382)