Skip to content
3 min read · 528 words

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

ParameterTypeDescription
reasonValidationErrorThe 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.constructor

Properties

PropertyModifierTypeDefault valueDescriptionOverridesInherited from
code?publicstringundefinedMachine-readable error code for narrowing exception-handling logic.-BaseException.code
details?readonlyValidationErrorItem[]undefinedThe raw field-level error details from the underlying ValidationError.--
fatal?publicbooleanundefinedWhen true, the ADK treats this error as unrecoverable and should halt the agent loop.-BaseException.fatal
help?publicstringundefinedHuman-readable guidance for resolving or reporting this error.-BaseException.help
namepublicstringundefinedName of the class that raised the exception.-BaseException.name
status?publicnumberundefinedHTTP status code associated with this error.-BaseException.status
codestaticstring'VALIDATION_EXCEPTION'Default machine-readable error code inherited by all instances.BaseException.code-
fatalstaticbooleanfalseWhether exceptions of this class are fatal by default.BaseException.fatal-
help?staticstringundefinedDefault help text inherited by all instances unless overridden at the throw site.-BaseException.help
message?staticstringundefinedDefault message used when no message is supplied to the constructor.-BaseException.message
statusstaticnumber422Default HTTP status code inherited by all instances.BaseException.status-

Accessors

[toStringTag]

Get Signature

ts
get toStringTag: string;
Returns

string

Inherited from

BaseException.[toStringTag]

Methods

toString()

ts
toString(): string;

Returns a string representation of an object.

Returns

string

Inherited from

BaseException.toString


isBaseException()

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

Returns true if value is a BaseException instance.

Parameters

ParameterTypeDescription
valueunknownThe 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.

Inherited from

BaseException.isBaseException