Skip to content

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 ​

ParameterType
resourceTypeResourceType
resourceIdstring
message?string
cause?Error

Returns ​

NotFoundError

Overrides ​

AIDKError.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
codereadonlyAIDKErrorCodeUnique error code for programmatic handlingAIDKError.codepackages/shared/src/errors.ts:100
detailsreadonlyRecord<string, unknown>Additional error detailsAIDKError.detailspackages/shared/src/errors.ts:103
resourceIdreadonlystringIdentifier of the resource-packages/shared/src/errors.ts:260
resourceTypereadonlyResourceTypeType 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 ​

ParameterType
jsonSerializedAIDKError

Returns ​

AIDKError

Inherited from ​

AIDKError.fromJSON


toJSON() ​

ts
toJSON(): SerializedAIDKError;

Defined in: packages/shared/src/errors.ts:131

Serialize error for transport (JSON-safe)

Returns ​

SerializedAIDKError

Inherited from ​

AIDKError.toJSON

Released under the MIT License.