Skip to content
3 min read · 570 words

Class: ValidationException

Defined in: lib/utils/validation.ts:69

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;

Defined in: lib/utils/validation.ts:81

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 fromDefined in
code?publicstringundefinedMachine-readable error code for narrowing exception-handling logic.-BaseException.codelib/classes/base_exception.ts:78
details?readonlyValidationErrorItem[]undefinedThe raw field-level error details from the underlying ValidationError.--lib/utils/validation.ts:75
fatal?publicbooleanundefinedWhen true, the ADK treats this error as unrecoverable and should halt the agent loop.-BaseException.fatallib/classes/base_exception.ts:88
help?publicstringundefinedHuman-readable guidance for resolving or reporting this error.-BaseException.helplib/classes/base_exception.ts:73
namepublicstringundefinedName of the class that raised the exception.-BaseException.namelib/classes/base_exception.ts:68
status?publicnumberundefinedHTTP status code associated with this error.-BaseException.statuslib/classes/base_exception.ts:83
codestaticstring'VALIDATION_EXCEPTION'Default machine-readable error code inherited by all instances.BaseException.code-lib/utils/validation.ts:71
fatalstaticbooleanfalseWhether exceptions of this class are fatal by default.BaseException.fatal-lib/utils/validation.ts:72
help?staticstringundefinedDefault help text inherited by all instances unless overridden at the throw site.-BaseException.helplib/classes/base_exception.ts:47
message?staticstringundefinedDefault message used when no message is supplied to the constructor.-BaseException.messagelib/classes/base_exception.ts:63
statusstaticnumber422Default HTTP status code inherited by all instances.BaseException.status-lib/utils/validation.ts:70

Accessors

[toStringTag]

Get Signature

ts
get toStringTag: string;

Defined in: lib/classes/base_exception.ts:130

Returns

string

Inherited from

BaseException.[toStringTag]

Methods

toString()

ts
toString(): string;

Defined in: lib/classes/base_exception.ts:134

Returns a string representation of an object.

Returns

string

Inherited from

BaseException.toString


isBaseException()

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

Defined in: lib/classes/base_exception.ts:29

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