AIDK API Reference / aidk-shared / NotFoundError
Class: NotFoundError ​
Defined in: packages/shared/src/errors.ts:255
Error thrown when a required resource cannot be found.
Example ​
typescript
throw new NotFoundError('model', 'gpt-4');
throw new NotFoundError('tool', 'search', 'Tool not found in registry');
throw new NotFoundError('execution', 'exec-123', 'Parent execution not found');Extends ​
Constructors ​
Constructor ​
ts
new NotFoundError(
resourceType: ResourceType,
resourceId: string,
message?: string,
cause?: Error): NotFoundError;Defined in: packages/shared/src/errors.ts:262
Parameters ​
| Parameter | Type |
|---|---|
resourceType | ResourceType |
resourceId | string |
message? | string |
cause? | Error |
Returns ​
NotFoundError
Overrides ​
Properties ​
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
code | readonly | AIDKErrorCode | Unique error code for programmatic handling | AIDKError.code | packages/shared/src/errors.ts:100 |
details | readonly | Record<string, unknown> | Additional error details | AIDKError.details | packages/shared/src/errors.ts:103 |
resourceId | readonly | string | Identifier of the resource | - | packages/shared/src/errors.ts:260 |
resourceType | readonly | ResourceType | Type of resource that was not found | - | packages/shared/src/errors.ts:257 |
Methods ​
fromJSON() ​
ts
static fromJSON(json: SerializedAIDKError): AIDKError;Defined in: packages/shared/src/errors.ts:163
Create error from serialized format
Parameters ​
| Parameter | Type |
|---|---|
json | SerializedAIDKError |
Returns ​
Inherited from ​
toJSON() ​
ts
toJSON(): SerializedAIDKError;Defined in: packages/shared/src/errors.ts:131
Serialize error for transport (JSON-safe)