Class: ValidationException
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
Constructors
Constructor
ts
new ValidationException(reason: ValidationError): ValidationException;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
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
|---|---|---|---|---|---|---|
code? | public | string | undefined | Machine-readable error code for narrowing exception-handling logic. | - | BaseException.code |
details? | readonly | ValidationErrorItem[] | undefined | The raw field-level error details from the underlying ValidationError. | - | - |
fatal? | public | boolean | undefined | When true, the ADK treats this error as unrecoverable and should halt the agent loop. | - | BaseException.fatal |
help? | public | string | undefined | Human-readable guidance for resolving or reporting this error. | - | BaseException.help |
name | public | string | undefined | Name of the class that raised the exception. | - | BaseException.name |
status? | public | number | undefined | HTTP status code associated with this error. | - | BaseException.status |
code | static | string | 'VALIDATION_EXCEPTION' | Default machine-readable error code inherited by all instances. | BaseException.code | - |
fatal | static | boolean | false | Whether exceptions of this class are fatal by default. | BaseException.fatal | - |
help? | static | string | undefined | Default help text inherited by all instances unless overridden at the throw site. | - | BaseException.help |
message? | static | string | undefined | Default message used when no message is supplied to the constructor. | - | BaseException.message |
status | static | number | 422 | Default HTTP status code inherited by all instances. | BaseException.status | - |
Accessors
[toStringTag]
Get Signature
ts
get toStringTag: string;Returns
string
Inherited from
Methods
toString()
ts
toString(): string;Returns a string representation of an object.
Returns
string
Inherited from
isBaseException()
ts
static isBaseException(value: unknown): value is BaseException;Returns true if value is a BaseException instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to test. |
Returns
value is BaseException
true when value is a BaseException 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 type for runtime detection and TypeScript narrowing.