Skip to content

Documentation / @agentick/shared / NotFoundError

Class: NotFoundError ​

Defined in: errors.ts:261

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 ​

new NotFoundError(resourceType, resourceId, message?, cause?): NotFoundError

Defined in: errors.ts:268

Parameters ​

resourceType ​

ResourceType

resourceId ​

string

message? ​

string

cause? ​

Error

Returns ​

NotFoundError

Overrides ​

AgentickError.constructor

Properties ​

cause? ​

readonly optional cause: Error

Defined in: errors.ts:108

Original error that caused this error

Inherited from ​

AgentickError.cause


code ​

readonly code: AgentickErrorCode

Defined in: errors.ts:102

Unique error code for programmatic handling

Inherited from ​

AgentickError.code


details ​

readonly details: Record<string, unknown>

Defined in: errors.ts:105

Additional error details

Inherited from ​

AgentickError.details


resourceId ​

readonly resourceId: string

Defined in: errors.ts:266

Identifier of the resource


resourceType ​

readonly resourceType: ResourceType

Defined in: errors.ts:263

Type of resource that was not found

Methods ​

fromJSON() ​

static fromJSON(json): AgentickError

Defined in: errors.ts:169

Create error from serialized format

Parameters ​

json ​

SerializedAgentickError

Returns ​

AgentickError

Inherited from ​

AgentickError.fromJSON


toJSON() ​

toJSON(): SerializedAgentickError

Defined in: errors.ts:137

Serialize error for transport (JSON-safe)

Returns ​

SerializedAgentickError

Inherited from ​

AgentickError.toJSON

Released under the ISC License.