# UpstashRatelimitError

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/callbacks/upstash_ratelimit_callback/UpstashRatelimitError)

Upstash Ratelimit Error

Raised when the rate limit is reached in `UpstashRatelimitHandler`

## Signature

```python
UpstashRatelimitError(
    self,
    message: str,
    type: Literal['token', 'request'],
    limit: Optional[int] = None,
    reset: Optional[float] = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `message` | `str` | Yes | error message |
| `type` | `str` | Yes | The kind of the limit which was reached. One of "token" or "request" |
| `limit` | `Optional[int]` | No | The limit which was reached. Passed when type is request (default: `None`) |
| `reset` | `Optional[int]` | No | unix timestamp in milliseconds when the limits are reset. Passed when type is request (default: `None`) |

## Extends

- `Exception`

## Constructors

```python
__init__(
    self,
    message: str,
    type: Literal['token', 'request'],
    limit: Optional[int] = None,
    reset: Optional[float] = None,
)
```

| Name | Type |
|------|------|
| `message` | `str` |
| `type` | `Literal['token', 'request']` |
| `limit` | `Optional[int]` |
| `reset` | `Optional[float]` |


## Properties

- `type`
- `limit`
- `reset`

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/callbacks/upstash_ratelimit_callback.py#L16)