# Class MCPServerError

Base error class for European Parliament MCP Server

Provides structured error handling with error codes, HTTP status codes, and optional details for debugging. All errors extend this base class.

#### Example

    throw new MCPServerError(
      'Configuration not found',
      'CONFIG_ERROR',
      500,
      { configFile: 'mcp.json' }
    );

#### Hierarchy (View Summary)

- Error
  - MCPServerError
    - ValidationError
    - RateLimitError
    - EPAPIError
    - GDPRComplianceError

- Defined in types/errors.ts:33

##### Index

### Constructors

constructor

### Properties

code
statusCode
details?

## Constructors

### constructor

- new MCPServerError(
  message: string,
  code: string,
  statusCode?: number,
  details?: unknown,
  ): MCPServerError

  Create a new MCP Server error

  #### Parameters

  - message: string

    Human-readable error message

  - code: string

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

  - statusCode: number = 500

    HTTP status code (default: 500)

  - `Optional` details: unknown

    Optional additional error details for debugging

  #### Returns MCPServerError

  Overrides Error.constructor

  - Defined in types/errors.ts:42

## Properties

### `Readonly` code

code: string

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

- Defined in types/errors.ts:44

### `Readonly` statusCode

statusCode: number = 500

HTTP status code (default: 500)

- Defined in types/errors.ts:45

### `Optional` `Readonly` details

details?: unknown

Optional additional error details for debugging

- Defined in types/errors.ts:46