---
url: 'https://adk.nht.io/api/@nhtio/adk/exceptions/classes/ValidationException.md'
description: Thrown when input fails schema validation.
---

# Class: ValidationException

Defined in: [lib/utils/validation.ts:69](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/utils/validation.ts#L69)

Thrown when input fails schema validation.

## Remarks

Carries the full `details` array from the underlying `ValidationError` so callers can surface
field-level messages without unwrapping the `cause` manually.

## Extends

* [`BaseException`](../../factories/classes/BaseException.md)

## Constructors

### Constructor

```ts
new ValidationException(reason: ValidationError): ValidationException;
```

Defined in: [lib/utils/validation.ts:81](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/utils/validation.ts#L81)

#### Parameters

| Parameter | Type              | Description                                                                                                                                                       |
| --------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `reason`  | `ValidationError` | The `ValidationError` thrown by the schema; its `details` are surfaced directly on this exception and its messages are joined to form the human-readable message. |

#### Returns

`ValidationException`

#### Overrides

[`BaseException`](../../factories/classes/BaseException.md).[`constructor`](../../factories/classes/BaseException.md#constructor)

## Properties

| Property                                 | Modifier   | Type                    | Default value            | Description                                                                             | Overrides                                                                                                                          | Inherited from                                                                                                                     | Defined in                                                                                                                |
| ---------------------------------------- | ---------- | ----------------------- | ------------------------ | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|  `code?`       | `public`   | `string`                | `undefined`              | Machine-readable error code for narrowing exception-handling logic.                     | -                                                                                                                                  | [`BaseException`](../../factories/classes/BaseException.md).[`code`](../../factories/classes/BaseException.md#property-code)       | [lib/classes/base\_exception.ts:78](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L78) |
|  `details?` | `readonly` | `ValidationErrorItem`\[] | `undefined`              | The raw field-level error details from the underlying `ValidationError`.                | -                                                                                                                                  | -                                                                                                                                  | [lib/utils/validation.ts:75](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/utils/validation.ts#L75)             |
|  `fatal?`     | `public`   | `boolean`               | `undefined`              | When `true`, the ADK treats this error as unrecoverable and should halt the agent loop. | -                                                                                                                                  | [`BaseException`](../../factories/classes/BaseException.md).[`fatal`](../../factories/classes/BaseException.md#property-fatal)     | [lib/classes/base\_exception.ts:88](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L88) |
|  `help?`       | `public`   | `string`                | `undefined`              | Human-readable guidance for resolving or reporting this error.                          | -                                                                                                                                  | [`BaseException`](../../factories/classes/BaseException.md).[`help`](../../factories/classes/BaseException.md#property-help)       | [lib/classes/base\_exception.ts:73](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L73) |
|  `name`        | `public`   | `string`                | `undefined`              | Name of the class that raised the exception.                                            | -                                                                                                                                  | [`BaseException`](../../factories/classes/BaseException.md).[`name`](../../factories/classes/BaseException.md#property-name)       | [lib/classes/base\_exception.ts:68](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L68) |
|  `status?`   | `public`   | `number`                | `undefined`              | HTTP status code associated with this error.                                            | -                                                                                                                                  | [`BaseException`](../../factories/classes/BaseException.md).[`status`](../../factories/classes/BaseException.md#property-status)   | [lib/classes/base\_exception.ts:83](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L83) |
|  `code`      | `static`   | `string`                | `'VALIDATION_EXCEPTION'` | Default machine-readable error code inherited by all instances.                         | [`BaseException`](../../factories/classes/BaseException.md).[`code`](../../factories/classes/BaseException.md#property-code-1)     | -                                                                                                                                  | [lib/utils/validation.ts:71](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/utils/validation.ts#L71)             |
|  `fatal`    | `static`   | `boolean`               | `false`                  | Whether exceptions of this class are fatal by default.                                  | [`BaseException`](../../factories/classes/BaseException.md).[`fatal`](../../factories/classes/BaseException.md#property-fatal-1)   | -                                                                                                                                  | [lib/utils/validation.ts:72](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/utils/validation.ts#L72)             |
|  `help?`     | `static`   | `string`                | `undefined`              | Default help text inherited by all instances unless overridden at the throw site.       | -                                                                                                                                  | [`BaseException`](../../factories/classes/BaseException.md).[`help`](../../factories/classes/BaseException.md#property-help-1)     | [lib/classes/base\_exception.ts:47](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L47) |
|  `message?` | `static`   | `string`                | `undefined`              | Default message used when no message is supplied to the constructor.                    | -                                                                                                                                  | [`BaseException`](../../factories/classes/BaseException.md).[`message`](../../factories/classes/BaseException.md#property-message) | [lib/classes/base\_exception.ts:63](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L63) |
|  `status`  | `static`   | `number`                | `422`                    | Default HTTP status code inherited by all instances.                                    | [`BaseException`](../../factories/classes/BaseException.md).[`status`](../../factories/classes/BaseException.md#property-status-1) | -                                                                                                                                  | [lib/utils/validation.ts:70](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/utils/validation.ts#L70)             |

## Accessors

### \[toStringTag]

#### Get Signature

```ts
get toStringTag: string;
```

Defined in: [lib/classes/base\_exception.ts:130](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L130)

##### Returns

`string`

#### Inherited from

[`BaseException`](../../factories/classes/BaseException.md).[`[toStringTag]`](../../factories/classes/BaseException.md#tostringtag)

## Methods

### toString()

```ts
toString(): string;
```

Defined in: [lib/classes/base\_exception.ts:134](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L134)

Returns a string representation of an object.

#### Returns

`string`

#### Inherited from

[`BaseException`](../../factories/classes/BaseException.md).[`toString`](../../factories/classes/BaseException.md#tostring)

***

### isBaseException()

```ts
static isBaseException(value: unknown): value is BaseException;
```

Defined in: [lib/classes/base\_exception.ts:29](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/base_exception.ts#L29)

Returns `true` if `value` is a [BaseException](../../factories/classes/BaseException.md) instance.

#### Parameters

| Parameter | Type      | Description        |
| --------- | --------- | ------------------ |
| `value`   | `unknown` | The value to test. |

#### Returns

`value is BaseException`

`true` when `value` is a [BaseException](../../factories/classes/BaseException.md) instance.

#### Remarks

Performs cross-realm-safe detection: tries `instanceof`, then `Symbol.hasInstance`, then
constructor-name comparison. The ADK does not export the `BaseException` class itself
as a constructable value — use this guard plus the [BaseException](../../factories/classes/BaseException.md) type for runtime
detection and TypeScript narrowing.

#### Inherited from

[`BaseException`](../../factories/classes/BaseException.md).[`isBaseException`](../../factories/classes/BaseException.md#isbaseexception)
