Class: BaseException
Defined in: lib/classes/base_exception.ts:16
Base class for all structured exceptions in the ADK.
Remarks
Subclasses should declare static code, status, fatal, and optionally help to avoid repeating those values on every instance. Instance-level options always take precedence over static defaults, so a single exception class can still be thrown with per-site overrides when needed.
The runtime cross-realm guard is inlined here rather than imported from ../utils/guards to break a circular-import chain: guards depends on validation, which extends BaseException. Importing the shared isInstanceOf helper into this file would create a load-order cycle that leaves BaseException undefined when ValidationException extends BaseException evaluates.
Extends
Error
Extended by
Constructors
Constructor
new BaseException(message?: string, options?: ErrorOptions & {
code?: string;
fatal?: boolean;
status?: number;
}): BaseException;Defined in: lib/classes/base_exception.ts:96
Parameters
| Parameter | Type | Description |
|---|---|---|
message? | string | Human-readable error message. Falls back to the static message on the subclass if omitted. |
options? | ErrorOptions & { code?: string; fatal?: boolean; status?: number; } | Standard ErrorOptions extended with code, status, and fatal overrides. Static defaults on the subclass are used when these are absent. |
Returns
BaseException
Overrides
Error.constructor;Properties
| Property | Modifier | Type | Description | Overrides | Defined in |
|---|---|---|---|---|---|
code? | public | string | Machine-readable error code for narrowing exception-handling logic. | - | lib/classes/base_exception.ts:78 |
fatal? | public | boolean | When true, the ADK treats this error as unrecoverable and should halt the agent loop. | - | lib/classes/base_exception.ts:88 |
help? | public | string | Human-readable guidance for resolving or reporting this error. | - | lib/classes/base_exception.ts:73 |
name | public | string | Name of the class that raised the exception. | Error.name | lib/classes/base_exception.ts:68 |
status? | public | number | HTTP status code associated with this error. | - | lib/classes/base_exception.ts:83 |
code? | static | string | Default machine-readable error code inherited by all instances. | - | lib/classes/base_exception.ts:51 |
fatal? | static | boolean | Whether exceptions of this class are fatal by default. | - | lib/classes/base_exception.ts:59 |
help? | static | string | Default help text inherited by all instances unless overridden at the throw site. | - | lib/classes/base_exception.ts:47 |
message? | static | string | Default message used when no message is supplied to the constructor. | - | lib/classes/base_exception.ts:63 |
status? | static | number | Default HTTP status code inherited by all instances. | - | lib/classes/base_exception.ts:55 |
Accessors
[toStringTag]
Get Signature
get toStringTag: string;Defined in: lib/classes/base_exception.ts:130
Returns
string
Methods
toString()
toString(): string;Defined in: lib/classes/base_exception.ts:134
Returns a string representation of an object.
Returns
string
isBaseException()
static isBaseException(value: unknown): value is BaseException;Defined in: lib/classes/base_exception.ts:29
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.