Class: BaseException
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;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
Accessors
[toStringTag]
Get Signature
get toStringTag: string;Returns
string
Methods
toString()
toString(): string;Returns a string representation of an object.
Returns
string
isBaseException()
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.