Praman — AI-First SAP UI5 Test Automation Platform - v1.0.1
    Preparing search index...

    Class PramanError

    Base error class for all Praman errors.

    Extends Error with structured diagnostic fields:

    • code — machine-readable error code from ErrorCode
    • attempted — human description of the operation that failed
    • retryable — whether the caller can retry the operation
    • severity — 'error', 'warning', or 'info'
    • details — structured key-value context
    • suggestions — recovery hints for humans and AI agents
    • timestamp — ISO 8601 creation time
    const error = new PramanError({
    code: 'ERR_CONFIG_INVALID',
    message: 'Invalid config',
    attempted: 'Load config',
    retryable: false,
    });
    logger.error(error.toUserMessage());

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attempted: string
    code: ErrorCode
    details: Readonly<Record<string, unknown>>
    retryable: boolean
    severity: "error" | "info" | "warning"
    suggestions: readonly string[]
    timestamp: string

    Methods

    • Returns structured context for AI agents to reason about the error.

      Returns AIErrorContext

      AI-friendly context object.

      Same as toJSON() but omits stack and name — AI agents don't need stack traces, and the error type is conveyed by code.

      const context = error.toAIContext();
      // Send to LLM for self-healing analysis
    • Serializes the error to a plain JSON-safe object.

      Returns SerializedPramanError

      Structured representation with all diagnostic fields.

      const json = error.toJSON();
      logger.debug(JSON.stringify(json, null, 2));
    • Formats the error for human-readable console output.

      Returns string

      Multi-line formatted string with all diagnostic sections.

      console.error(error.toUserMessage());