---
url: /nestjs-odata/api/generated/interfaces/ODataErrorMapping.md
---
# Interface: ODataErrorMapping

Defined in: [response/odata-error.ts:19](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L19)

What an [ODataErrorMapper](../type-aliases/ODataErrorMapper.md) returns: the OData error to send for an exception.

Serialized as `{ "error": { code, message, target?, details, innererror? } }` with HTTP
status `status`.

## Properties

### code

> `readonly` **code**: `string`

Defined in: [response/odata-error.ts:23](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L23)

Service-defined error code, e.g. `'CLIENT_NOT_FOUND'`.

***

### details?

> `readonly` `optional` **details?**: readonly [`ODataErrorDetail`](ODataErrorDetail.md)\[]

Defined in: [response/odata-error.ts:29](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L29)

Additional errors, e.g. one per invalid property.

***

### innererror?

> `readonly` `optional` **innererror?**: `Readonly`<`Record`<`string`, `unknown`>>

Defined in: [response/odata-error.ts:31](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L31)

Service-defined debugging information. Do not put secrets or stack traces here.

***

### language?

> `readonly` `optional` **language?**: `string`

Defined in: [response/odata-error.ts:37](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L37)

Language of `message` as an RFC 5646 tag (`'es-CO'`), sent as the `Content-Language`
response header (OData-Protocol 4.01 §9.4). Default: the `errorLanguage` module option,
else `'en'`.

***

### message

> `readonly` **message**: `string`

Defined in: [response/odata-error.ts:25](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L25)

Human-readable message, sent to the client as is.

***

### status

> `readonly` **status**: `number`

Defined in: [response/odata-error.ts:21](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L21)

HTTP status code, 400–599.

***

### target?

> `readonly` `optional` **target?**: `string` | `null`

Defined in: [response/odata-error.ts:27](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/odata-error.ts#L27)

The target of the error, e.g. the property name that failed validation (may be null).
