# DescriptionAndOptions

**Kind:** Interface

**Source:** [`packages/common/exceptions/http.exception.ts`](https://github.com/nestjs/nest/blob/master/packages/common/exceptions/http.exception.ts#L14)

**Part of:** [Common](subsystem-packages-common)

`DescriptionAndOptions` groups a human-readable exception description with the `HttpExceptionOptions` used to configure how an HTTP exception is created or handled. It is typically used internally when normalizing exception constructor arguments into a consistent structure.

## Properties

| Property | Type |
|---|---|
| `description` | `string` |
| `httpExceptionOptions` | `HttpExceptionOptions` |

## Diagram

```mermaid
graph LR
  A[Exception input] --> B[DescriptionAndOptions]
  B --> C[description: string]
  B --> D[httpExceptionOptions: HttpExceptionOptions]
  D --> E[HTTP exception configuration]
```

## Usage

```ts
import type { HttpExceptionOptions } from './http.exception';

interface DescriptionAndOptions {
  description: string;
  httpExceptionOptions: HttpExceptionOptions;
}

const exceptionDetails: DescriptionAndOptions = {
  description: 'The requested user could not be found.',
  httpExceptionOptions: {
    cause: new Error('User lookup returned no result'),
  },
};

// Use the normalized values when constructing an HTTP exception.
const { description, httpExceptionOptions } = exceptionDetails;
```

## AI Coding Instructions

- Keep `description` as a clear, client-safe string explaining the exception condition.
- Pass exception metadata through `httpExceptionOptions` rather than adding unrelated fields to this interface.
- Preserve the `cause` option when wrapping lower-level errors so error chains remain traceable.
- Use this shape when normalizing overloaded HTTP exception constructor inputs into a single internal representation.
