# protocol_error

> **Function** in `langgraph_sdk`

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

Build the error for a protocol `{"type": "error"}` envelope.

## Signature

```python
protocol_error(
    response: dict[str, Any],
) -> RuntimeError
```

---

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