Praman — Agent-First SAP UI5 Test Automation Plugin - v1.2.0
    Preparing search index...

    Class ODataError

    Error subclass for OData request failures.

    const error = new ODataError({
    message: 'OData request failed',
    attempted: 'Fetch entity set',
    statusCode: 500,
    });

    BC-SRV-OData

    Request failed — OData HTTP request returned error status

    Parse error — OData response body could not be parsed as JSON/XML

    CSRF expired — x-csrf-token is stale and needs refresh

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new ODataError instance.

      Parameters

      • options: ODataErrorOptions

        OData error construction options including HTTP status code, request URL, and entity set context for the failing operation.

      Returns ODataError

      import { ODataError } from '#core/errors/odata-error.js';

      const error = new ODataError({
      message: 'OData request failed with status 403',
      attempted: 'Fetch purchase orders from PurchaseOrder entity set',
      statusCode: 403,
      requestUrl: '/sap/opu/odata/sap/API_PURCHASEORDER_PROCESS_SRV/PurchaseOrder',
      entitySet: 'PurchaseOrder',
      });

    Properties

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

    Methods

    • Returns AI-agent-friendly context with OData-specific diagnostic fields.

      Returns AIErrorContext & {
          entitySet: string | undefined;
          requestUrl: string | undefined;
          statusCode: number | undefined;
      }

      Base AI context extended with HTTP status, request URL, and entity set details.

      const ctx = error.toAIContext();
      // LLM can use ctx.statusCode to determine if the error is auth-related (401/403)
      // and ctx.entitySet to suggest the correct OData service path
    • Serializes this error to a JSON-safe object with OData-specific fields.

      Returns SerializedPramanError & {
          entitySet: string | undefined;
          requestUrl: string | undefined;
          statusCode: number | undefined;
      }

      Base serialization extended with statusCode, requestUrl, and entitySet.

      const json = error.toJSON();
      console.log(json.statusCode); // 403
      console.log(json.entitySet); // 'PurchaseOrder'
      console.log(json.requestUrl); // '/sap/opu/odata/sap/.../PurchaseOrder'
    • Formats the error for human-readable console output.

      Returns string

      Multi-line formatted string with all diagnostic sections.

      console.error(error.toUserMessage());