# Class RateLimitError

Rate limit error when API rate limit is exceeded

Thrown when the client exceeds the configured rate limit. Always returns HTTP 429 status and includes retry-after information.

#### Example

    if (requestCount > maxRequests) {
      throw new RateLimitError(
        'Rate limit exceeded',
        60 // retry after 60 seconds
      );
    }

#### Hierarchy (View Summary)

- MCPServerError
  - RateLimitError

- Defined in types/errors.ts:99

##### Index

### Constructors

constructor

### Properties

code
statusCode
details?
retryAfter?

## Constructors

### constructor

- new RateLimitError(message: string, retryAfter?: number): RateLimitError

  Create a new rate limit error

  #### Parameters

  - message: string

    Description of rate limit violation

  - `Optional` retryAfter: number

    Number of seconds to wait before retrying (optional)

  #### Returns RateLimitError

  Overrides MCPServerError.constructor

  - Defined in types/errors.ts:106

## Properties

### `Readonly` code

code: string

Machine-readable error code (e.g., 'VALIDATION_ERROR')

Inherited from MCPServerError.code

- Defined in types/errors.ts:44

### `Readonly` statusCode

statusCode: number = 500

HTTP status code (default: 500)

Inherited from MCPServerError.statusCode

- Defined in types/errors.ts:45

### `Optional` `Readonly` details

details?: unknown

Optional additional error details for debugging

Inherited from MCPServerError.details

- Defined in types/errors.ts:46

### `Optional` `Readonly` retryAfter

retryAfter?: number

Number of seconds to wait before retrying (optional)

- Defined in types/errors.ts:108