# stream_error_frame

> **Function** in `langgraph_sdk`

📖 [View in docs](https://reference.langchain.com/python/langgraph-sdk/stream/errors/stream_error_frame)

Return the error in an unsolicited `{"type": "error", "id": null}` frame.

The server sends one just before it closes a thread stream whose read failed.

## Signature

```python
stream_error_frame(
    event: Any,
) -> RuntimeError | None
```

---

[View source on GitHub](https://github.com/langchain-ai/langgraph/blob/5847733bcb186c26b32da5cc822eaf8a89deffeb/libs/sdk-py/langgraph_sdk/stream/errors.py#L18)