Class PromptEngineError

Custom error class for all errors originating from the PromptEngine. This allows for specific catching and handling of prompt construction failures. PromptEngineError

Hierarchy

  • Error
    • PromptEngineError

Constructors

Properties

Constructors

  • Creates an instance of PromptEngineError.

    Parameters

    • message: string

      A human-readable description of the error.

    • code: string

      A specific error code (e.g., 'TEMPLATE_NOT_FOUND').

    • Optional component: string

      The engine component where the error originated.

    • Optional details: unknown

      Additional context or the underlying error.

    Returns PromptEngineError

Properties

code: string

A specific error code for programmatic handling (e.g., 'TEMPLATE_NOT_FOUND', 'TOKEN_LIMIT_EXCEEDED_IRRECOVERABLY').

component?: string

Optional: The specific component or operation within the PromptEngine where the error occurred (e.g., 'TokenBudgeting', 'TemplateFormatting', 'ContextualElementSelection').

details?: unknown

Optional: Additional structured details about the error, which might include relevant data like modelId, offending component, or configuration issue.