Creates an instance of PromptEngineError.
A human-readable description of the error.
A specific error code (e.g., 'TEMPLATE_NOT_FOUND').
Optional component: stringThe engine component where the error originated.
Optional details: unknownAdditional context or the underlying error.
Readonly codeA specific error code for programmatic handling (e.g., 'TEMPLATE_NOT_FOUND', 'TOKEN_LIMIT_EXCEEDED_IRRECOVERABLY').
Optional Readonly componentOptional: The specific component or operation within the PromptEngine where the error occurred (e.g., 'TokenBudgeting', 'TemplateFormatting', 'ContextualElementSelection').
Optional Readonly detailsOptional: Additional structured details about the error, which might include relevant data like modelId, offending component, or configuration issue.
Custom error class for all errors originating from the PromptEngine. This allows for specific catching and handling of prompt construction failures. PromptEngineError